note 70809 added to faq.installation
| From: | Phani at example dot com | Date: | Sun, 29 Oct 2006 15:52:28 +0000 |
| Subject: | note 70809 added to faq.installation | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119228@lists.php.net to get a copy of this message | ||
Hello All,
I have installed below versions and finally managed to execute php scripts:
Apache/2.2.3
PHP Version => 5.1.6
First I tried the below two approaches:
Adding php as module
Always failed saying that 'couldn't find the module'
Executing php as cgi
Don't remember the exact error, but wasn't successful
Then I did the following:
Read in the apache docs that defining 'ScriptAlias' to a directory would mean Apache shall
treat all scripts under that directory as CGI scripts and execute them. While doing so it shall
look for the #! in the first line for the executable. To summarize:
1. Installed Apache 2.2.3
2. Installed PHP5.1.6
3. By default ScriptAlias was pointing to "<Apache installed dir>/cgi-bin". So have
placed an example php script in the cgi-bin folder
4. From browser requested the script http://localhost:8080/cgi-bin/phpinfo.php
5. PHP script got executed successfully and browser displayed the expected output.
6. Only thing to remember is in the script one has put this line in the biginning 'print
"Content-type: text/plain; charset=iso-8859-1\n\n";' else it was throwing
'malformed header from script. Bad header=phpinfo(): phpinfo.php'.
I hope this helps to other who want to execute php scripts in apache right away!!
I would like to know others comments on the above approach.
Thanks
----
Server IP: 216.194.113.175
Probable Submitter: 71.250.218.66 (proxied: 10.1.219.219)
----
Manual Page -- http://www.php.net/manual/en/faq.installation.php
Edit -- https://master.php.net/note/edit/70809
Del: integrated -- https://master.php.net/note/delete/70809/integrated
Del: useless -- https://master.php.net/note/delete/70809/useless
Del: bad code -- https://master.php.net/note/delete/70809/bad+code
Del: spam -- https://master.php.net/note/delete/70809/spam
Del: non-english -- https://master.php.net/note/delete/70809/non-english
Del: in docs -- https://master.php.net/note/delete/70809/in+docs
Del: other reasons-- https://master.php.net/note/delete/70809
Reject -- https://master.php.net/note/reject/70809
Search -- https://master.php.net/manage/user-notes.php