The former (file://) downloads the PHP file, while the latter (http://localhost), which is what I have been using successfully, parses and executes the PHP correctly.
The former (file://) downloads the PHP file, while the latter (http://localhost), which is what I have been using successfully, parses and executes the PHP correctly.
Just to expand on that. PHP is a server side language, which means the web server (Apache/Nginx/IIS, whatever) executes it and spits back the output to the browser.
If you are opening the php file as a file and not through the web server, it will show the contests of the file itself and not parse it.
Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide
Tomorrow's an illusion and yesterday's a dream, today is a solution...
I'm having a similar problem with .pl (or .cgi) files. They are in the ScriptAlias directory, permissions are 755 for both the directory and the file.
Here's the relevant part of the .vhost file:
<Directory /var/www/clients/client3/web12/cgi-bin/>
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /var/www/clients/client3/web12/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
The file runs correctly from the command line, but when I access it via the web, instead of executing, it tries to download.
I've spent the better part of the last two days trying to figure this out. Any help will be GREATLY appreciated.
Have you considered adding mod_perl to Apache and using that for .pl files?
What are the .cgi file written in? Are they binaries or scripts?Code:sudo apt-get install libapache2-mod-perl2 libapache2-mod-perl2-doc
If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.
Blog · Linode System Administration Guides · Android Apps for Ubuntu Users
Thanks for all the helpful information and advice. I'm marking this as solved.
Bookmarks