473,856 Members | 1,755 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 8287
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
2784
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 web app is located. Because we are using the iusr is there simple exploit code that could allow...
7
2558
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 upload is allowed/possible/needed. Login is manged by the ASP script
4
2701
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
13317
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 drive. But if you don't have Read access to the folder, there's trouble. The user can see the...
26
2989
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 damage the file. Is this possible or do we need to simply give everyone read/write privileges, but...
3
4826
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 to me and sure enough, I cannot change the files. Is there a different way to deal with...
7
4099
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
3881
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 the DB only so they can view the data. Now if I give them full permissions to the folder where...
6
29504
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 scenes with file permissions or virtual roots?
0
9916
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9762
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11056
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10696
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9531
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7932
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5761
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5958
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4575
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.