note 70809 deleted from faq.installation by nlopess

From: Date: Sun, 29 Oct 2006 15:53:37 +0000
Subject: note 70809 deleted from faq.installation by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-119229@lists.php.net to get a copy of this message
Note Submitter: Phani at example dot com ---- 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

« previous php.notes (#119229) next »