counterpoint Posted March 3, 2009 Share Posted March 3, 2009 I'm trying to build from sources a basic installation of Apache (2.2.11) with PHP (5.2.9) running as CGI on CentOS 5.2. The Apache configuration was (according to config.nice): #! /bin/sh # # Created by configure "./configure" \ "--prefix=/usr/local/apache" \ "--enable-rewrite" \ "--enable-so" \ "--enable-expires" \ "--enable-deflate" \ "--disable-imap" \ "--disable-userdir" \ "--disable-include" \ "$@" With this installed and running, the test HTML web page is served correctly. Then I compiled PHP with: ./configure \ --enable-force-cgi-redirect \ --prefix=/usr/local/apache/php Then copied the PHP binary to the Apache cgi-bin directory, and modified httpd.conf with: Action application/x-httpd-php /usr/local/apache/php/cgi-bin/php AddHandler application/x-httpd-php .php After restarting index.html is still served ok, but attempting a test PHP file called info.php (containing phpinfo()) gives: The requested URL /usr/local/apache/bin/php/info.php was not found on this server. I've read everything I can find, and experimented with the config, but always get either this error or a server 500 if I really mess things up! Any offers on the direction to take to get out of this? Quote Link to comment https://forums.phpfreaks.com/topic/147756-install-php-as-cgi-in-apache/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.