HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   500 internal error if files has write permission in the group (http://www.howtoforge.com/forums/showthread.php?t=37669)

Thomas Jensen 23rd July 2009 12:54

500 internal error if files has write permission in the group
 
Hi,

I have a PHP site, which allows me to upload pictures.
There's no trouble uploading the file, but the the file permissions on the picture is not "read by all groups", and the result is that i can't view the file in a browser.
My first thought was the give the uploading PHP file permissions to write, but when i do that, i get an internal error 500.

It's running in suPHP.

Thomas Jensen 27th July 2009 11:38

Please, anybody?

Mark_NL 27th July 2009 11:45

what does your apache error log tell you when you get the 500 error?

till 27th July 2009 12:02

This is one of the security mechanisms of suphp, you can change this in the suphp.conf file.

Thomas Jensen 27th July 2009 12:14

Okay, where do i find it?

till 27th July 2009 12:18

Almost all linux config files are in /etc. As the program is named suphp, you will find the file in the directory /etc/suphp/

And in case that you dont find a file on your server, just use the command locate. E.g.:

locate suphp.conf

Thomas Jensen 27th July 2009 12:52

Found it, thanks, but:

server1:/# locate suphp.conf
-bash: locate: command not found

The images is still only given read and write permissions for owner, and can't be viewed in the browser :(

till 27th July 2009 12:53

Quote:

The images is still only given read and write permissions for owner, and can't be viewed in the browser
Then this is a problem with your image upload script as the permissions of the file are set by the php script that uploads the file.

Thomas Jensen 27th July 2009 12:59

I use the same script which worked on another server, I've given the file chmod 777. It's a standard PHP (move_uploaded_file) script :/

till 27th July 2009 13:01

Your problem is not the permissions of the upload script, your problem is that the upload script sets wrong permissions for the uploaded image file. Your upload script must contain a chmod command to set the permissions of the uploadedc image file correctly.


All times are GMT +2. The time now is 23:06.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.