HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Installation/Configuration (
-   -   File upload problems in PHP (

becks87 8th March 2011 09:50

File upload problems in PHP

I have ISPConfig 2 installed on Ubuntu 10.04 server. My problem is that I have a php code in many of my own coded websites where customers can create folders and upload docs in it. The problem is that the main folder, which i created by FTP is working (i mean i can create dirs and files into it), but the created subfolders is not working, i cannot create another dirs or files in it. I found that the problem is in the privileges of the linux server, the parent dir created by customer:web# and the subfolders wwwdata:wwwdata. If i change manually the subfolders owner and group, it comes working. How can i make it work with the least administrative effort and not decreasing security. If there is any htaccess solution, it would be also acceptable but when i tried to solve this problem with it i always found an internal server error 500 message. But i'm not an expert in linux systems...
Please help!

till 8th March 2011 10:18

Switch from mod_php to suphp:

becks87 8th March 2011 10:45

Thanks for your reply. Before i starting to make drastic modifications in my apache server i want to know how it is affect the other customers code? Is it a risky operation to change? I also want to make this with the less drop-out to others. Moreover the link you got is for Ubuntu 7.10. Can it safely work on 10.04? I'm not an expert in this theme so i'm a bit frightened to make the server unstable or malfunctioning in php and cannot do the old config back. Thanks again for your help!

till 8th March 2011 10:55

Currently you use mod_php. mod_php is a apache module for PHP which runs the php processes under the apache user (www-data). This causes problems when you try to upload files with PHP as the apache user and web / FTP user are different.

With suphp, the php scripts will be run under the website user (which is the same then the FTP user). This is also mosre secure then using mod_php as every website runs php processes under different users then.

The main drawback is that suphp is a bit slower as php processes were started as cgi and that you can nout use settings like php_admin or php_flag in .htaccess files, in suphp you use custom php.ini files for that instead.

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

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