Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

regular PHP vs. Apache PHP module

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

regular PHP vs. Apache PHP module

Postby eyewoo » Fri Jun 06, 2003 10:00 am

I developed a PHP program that creates both files and subdirectories as part of its operation. It was developed on a server running regular PHP, version 4.2.3.

Then I ported it to a server running the Apached PHP module version 4.2.2. Nothing worked. The problem apparently has to do with directory permissions. On the server running regular PHP, directory permissions could be set to 0755 (just the Owner permission set to "write"), but on the mod PHP setup, the permissions on directories have to be set to 0777 (Owner, Group and Public set to "write").

I'm not sure what my question is here... I guess I'm just trying to verify that my understanding is correct. Is it? :?:
eyewoo
New php-forum User
New php-forum User
 
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA

Postby Redcircle » Fri Jun 06, 2003 11:37 am

Are you getting any errors or is it just not working.. usually the errors point you to where to look.

Usually Apache runs as user Nobody so you would have to use 777 like you mentioned. If nobody is in the same usergroup as your username you can use 775
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby eyewoo » Fri Jun 06, 2003 12:02 pm

Apparently when an Apache server is using the mod PHP, it takes ownership of any files or subdirectories that are created when they are created, so if the directory in which a file resides is not set to 0777, it is not possible to write to to the file. I have no idea why it has to be that way. It is not that way when a server is running regular PHP.

The advantage to the mod PHP is speed. It is supposed to be faster.

I'm working out the problems in the application... i.e. when it creates subdirectories, it CHMODs them immediately to 0777. Then and files created in the subdiretory work fine for reading, writing and removing... the 3 Rs... :)
eyewoo
New php-forum User
New php-forum User
 
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA


Return to PHP coding => General

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron