File upload problems in PHP

Discussion in 'Installation/Configuration' started by becks87, Mar 8, 2011.

  1. becks87

    becks87 New Member

    Hi!

    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!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. becks87

    becks87 New Member

    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!
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    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.
     

Share This Page