Help - Search - Members - Calendar
Full Version: Scripts
Linuxhelp > Support > Technical Support
zeitgeist
Where do i keep php and perl scripts in apache2? i am on madrake 9.1
is cgi-cin only for .cgi scripts? because i got a sample perl script with apache 2 which works in cgi-bin!
Also i noticeed that php wont work in cgi-bin, just in documentroot.
hughesjr
scripts (.pl, .cgi, etc) can run in any directory ... if the directory permissions allow it. The directory permissions are setup in the httpd.conf file (normally /etc/httpd/conf/httpd.conf). Normally, it is not safe to execute scripts in all directories ... and you want to limit scripts to running in one directory (that you can control permissions on a little more tightly) .... and /cgi-bin is a standard place to do it. Perl scripts are a type of CGI files.

Directories where .php files can be run are controlled in a similar manner, but normally in a file called /etc/php.ini.

If you are putting files on an ISP server, you probably don't need to worry about those files, you will only be able to run .pl and .cgi files in /cgi-bin and you will normally be able to use .php files in all directories except /cgi-bin .... BUT if you are setting up your own server then configuration of the httpd.conf and php.ini files are VERY important for server security!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.