Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

permissions for php script

Status
Not open for further replies.

kelly5518

Technical User
Aug 1, 2005
72
US
Hi,

I'm new to working with php scripts but I've installed quite a few perl scripts and always had to chmod the perl script to 755. Is chmod necessary with php scripts, for example, a form processing script that mails the results to the webmaster?

Or is it just a matter of the permissions of the directory that the script is located? If so, what should they be? 777 seems like overkill and a security risk for a form processing script that's simply mailing the results.

I hope someone can shed some light on this for me.

Thanks a bunch,
 
if it is a web based php script (IE you are sending it variables via post or get or some other method), you shouldnt have to modify the permissions.

If you just want to make it an executable, you can do chmod +x script.php
 
If you are talking about a script that is processed through the web server, then there's nothing to do. The server (if installed correctly) should automatically parse and process the .php file. ALl it needs to do that is be able to read the source.
 
To clarify, the user under which Apache runs must be able to read the files. You'll want the permissions to be at least 640 with owne=you and group=apache.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top