473,569 Members | 3,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

folder and file permissions to read and write images

Hello PHP Group,

I am having trouble setting permissions correctly so that the
magickwand api (php 5.2) can read and
write images. I usually read a file from one directory, create a
magickwand resource from that file,
and transform the image, and save the new image with a new name to a
different directory.

I have seen that my file and folder permissions when set incorrectly,
will definitely cause problems!
Below is a copy of an error message I get when I try to read an image
and write, etc.

Fatal Error: magickreadimage (): C API cannot read the file
"/usr/local/apache2/htdocs/portfolios/25/coffeeandcars.J PG"
(reason: unable to open image `/usr/local/apache2/htdocs/portfolios/25/
coffeeandcars.J PG':
Permission denied) [on C source line 392] (# 256).

Error in line 58 of file '/usr/local/apache2/htdocs/portfolios/
thumbmaker.php' .

Script: '/portfolios/thumbmaker.php' .
I have tried setting the owner and group to apache.apache, and
apache.webdev (webdev is a group I created, where the apache user and
another user are a member). I am running the Apache web server as the
user "apache".

Any suggestions on the correct permissions to get the read and writes
to work??

thanks,
eholz1

Mar 15 '07 #1
3 8273
Am 15 Mar 2007 10:45:04 -0700 schrieb eholz1:
Hello PHP Group,

I am having trouble setting permissions correctly so that the
magickwand api (php 5.2) can read and
write images. I usually read a file from one directory, create a
magickwand resource from that file,
and transform the image, and save the new image with a new name to a
different directory.

I have seen that my file and folder permissions when set incorrectly,
will definitely cause problems!
Below is a copy of an error message I get when I try to read an image
and write, etc.

Fatal Error: magickreadimage (): C API cannot read the file
"/usr/local/apache2/htdocs/portfolios/25/coffeeandcars.J PG"
(reason: unable to open image `/usr/local/apache2/htdocs/portfolios/25/
coffeeandcars.J PG':
Permission denied) [on C source line 392] (# 256).

Error in line 58 of file '/usr/local/apache2/htdocs/portfolios/
thumbmaker.php' .

Script: '/portfolios/thumbmaker.php' .
I have tried setting the owner and group to apache.apache, and
apache.webdev (webdev is a group I created, where the apache user and
another user are a member). I am running the Apache web server as the
user "apache".

Any suggestions on the correct permissions to get the read and writes
to work??

thanks,
eholz1
Hello!

The problem probably lies in the actual permissions and not in who is the
owner of the file. The user has to have writing access as for example: 755
(owner has right to write and read, as well as execute, group and other can
read and execute only). Note that some php functions need exec right to
work properly.

If you have set the right to 755 or 744 or whatever the owner of the file
must be Apache. The user can have different names like www, wwwrun or as
you said apache. If your script doesn't work a different user seems to run
the scripts when you access them via HTTP.

If you can't find the proper user to set as owner just assign 777 to the
images folder so everyone can read and write. Of course the images have to
have the same rights when they shall be overwritten at any time.
~ MK
Mar 15 '07 #2
On Mar 15, 10:34 am, "Mathias K." <mformetalh...@ yahoo.dewrote:
Am 15 Mar 2007 10:45:04 -0700 schrieb eholz1:
Hello PHP Group,
I am having trouble setting permissions correctly so that the
magickwand api (php 5.2) can read and
write images. I usually read a file from one directory, create a
magickwand resource from that file,
and transform the image, and save the new image with a new name to a
different directory.
I have seen that my file and folder permissions when set incorrectly,
will definitely cause problems!
Below is a copy of an error message I get when I try to read an image
and write, etc.
Fatal Error: magickreadimage (): C API cannot read the file
"/usr/local/apache2/htdocs/portfolios/25/coffeeandcars.J PG"
(reason: unable to open image `/usr/local/apache2/htdocs/portfolios/25/
coffeeandcars.J PG':
Permission denied) [on C source line 392] (# 256).
Error in line 58 of file '/usr/local/apache2/htdocs/portfolios/
thumbmaker.php' .
Script: '/portfolios/thumbmaker.php' .
I have tried setting the owner and group to apache.apache, and
apache.webdev (webdev is a group I created, where the apache user and
another user are a member). I am running the Apache web server as the
user "apache".
Any suggestions on the correct permissions to get the read and writes
to work??
thanks,
eholz1

Hello!

The problem probably lies in the actual permissions and not in who is the
owner of the file. The user has to have writing access as for example: 755
(owner has right to write and read, as well as execute, group and other can
read and execute only). Note that some php functions need exec right to
work properly.

If you have set the right to 755 or 744 or whatever the owner of the file
must be Apache. The user can have different names like www, wwwrun or as
you said apache. If your script doesn't work a different user seems to run
the scripts when you access them via HTTP.

If you can't find the proper user to set as owner just assign 777 to the
images folder so everyone can read and write. Of course the images have to
have the same rights when they shall be overwritten at any time.

~ MK
Hello Mathias

Sie haben recht! Ich machen alles 0755 fur meine folders and files,
Alles in Ordnung jetz!
Ich bin dumm.

I am thinking setting 755 was too easy!
Live and learn,
fielen Danke!
Thanks,
eholz1

Mar 15 '07 #3
Am 15 Mar 2007 14:58:18 -0700 schrieb eholz1:
On Mar 15, 10:34 am, "Mathias K." <mformetalh...@ yahoo.dewrote:
>Am 15 Mar 2007 10:45:04 -0700 schrieb eholz1:
>>Hello PHP Group,
>>I am having trouble setting permissions correctly so that the
magickwand api (php 5.2) can read and
write images. I usually read a file from one directory, create a
magickwand resource from that file,
and transform the image, and save the new image with a new name to a
different directory.
>>I have seen that my file and folder permissions when set incorrectly,
will definitely cause problems!
Below is a copy of an error message I get when I try to read an image
and write, etc.
>>Fatal Error: magickreadimage (): C API cannot read the file
"/usr/local/apache2/htdocs/portfolios/25/coffeeandcars.J PG"
(reason: unable to open image `/usr/local/apache2/htdocs/portfolios/25/
coffeeandcars .JPG':
Permission denied) [on C source line 392] (# 256).
>>Error in line 58 of file '/usr/local/apache2/htdocs/portfolios/
thumbmaker.ph p'.
>>Script: '/portfolios/thumbmaker.php' .
>>I have tried setting the owner and group to apache.apache, and
apache.webd ev (webdev is a group I created, where the apache user and
another user are a member). I am running the Apache web server as the
user "apache".
>>Any suggestions on the correct permissions to get the read and writes
to work??
>>thanks,
eholz1

Hello!

The problem probably lies in the actual permissions and not in who is the
owner of the file. The user has to have writing access as for example: 755
(owner has right to write and read, as well as execute, group and other can
read and execute only). Note that some php functions need exec right to
work properly.

If you have set the right to 755 or 744 or whatever the owner of the file
must be Apache. The user can have different names like www, wwwrun or as
you said apache. If your script doesn't work a different user seems to run
the scripts when you access them via HTTP.

If you can't find the proper user to set as owner just assign 777 to the
images folder so everyone can read and write. Of course the images have to
have the same rights when they shall be overwritten at any time.

~ MK

Hello Mathias

Sie haben recht! Ich machen alles 0755 fur meine folders and files,
Alles in Ordnung jetz!
Ich bin dumm.

I am thinking setting 755 was too easy!
Live and learn,
fielen Danke!
Thanks,
eholz1
Hehe, good that the solution was that easy.

Du bist nicht dumm, irren ist menschlich. ;-)
Wie du sagtest, leben und lernen. :)
Mit freundlichem Gruß,

M.K.
Mar 16 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2763
by: Brett | last post by:
We have an application where the iusr_<srvr> has write NTFS permissions to a folder under the wwwroot (i.e. wwwroot\folder) and also there is a SQL Server database where we must give the iusr_<srvr> read and write permissions on the database in order for the application to work. Anonymous access is enabled on the default web site where this...
7
2546
by: Kim Lots | last post by:
Hi Sorry to disturb you again but i really like to know what's the NTFS folder permissions on a "virtual directory" folder for a public webserver iis 5.x running ASP 3.0 with an Access DB on a w2k pro machine with anonymous access. Fyg this is non commercial website for neighbour members in a carpool with booking possibility. No file...
4
2688
by: Richard | last post by:
Hi all, Is there any class in .NET 1.x that will help me set file & folder permissions for a user? Aka - I would like to do the in code equivalent of right clicking a folder in file explorer and granting read/write access to a specific user {not the user running the program}. Any ideas? Or am I going to have to PInvoke like crazy??
5
13260
by: Mitchell S. Honnert | last post by:
Is there a way, given the full path of a folder on a network, that one can programatically tell if you have Read access to that folder? I have an application where the user is able to select a number of search folders using the standard dialog control. There shouldn't be an issue with the search folder being on a local drive or a network...
26
2946
by: Trish | last post by:
I have an Access 2003 database application consisting of a frontend on each user's desktop and a backend on a network drive. I have been asked to move the backend into a folder that the users can't actually see from Windows Explorer - a folder for which only a few of us have privileges. The fear is that someone will accidentally delete or...
3
4814
by: James Maeding | last post by:
I am familiar with using My.Computer.FileSystem.GetDirectoryInfo to get folder attributes, see code below... This does not work though for network drives on my companies system. We use windows as our server, nothing exotic. I looked at the security permissions and the "write" box for domain users was grey, but not checked. This means read-only...
7
4083
by: Zeb | last post by:
Hi all I've developed a shopping cart in C# and to allow moderators to upload product images, news images and downloadable PDFs, the app creates a folder for each product. I start out with the following empty folders: /img/products/ /img/news/ /pdf/
8
3862
by: paquer | last post by:
Database Users need to have Read/Write etc... permissions to the folder where the Database resides in order to create the lock file. I have read only users. I have set up the Shortcut that links to the 'Workgroup Info File' with permissions for said database. Within this 'WIF' File I have "Read Only" user's who are only provided access to...
6
29459
by: Andy Fish | last post by:
Hi, From what I can gather, under Asp.Net 2.0, it is safe to put data and config files underneath the app_data in the web root and they will not be served directly to the browser from a URL. Can anyone explain just how this feature works. is app_data a reserved name for IIS and ASP.Net, or is there some jiggery pokery going on behind the...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.