/usr/bin/pgp-cgi does not exists.
When I use:
CGIhandler = /usr/bin/php:php
I do get output wen I use http://localhost/phpinfo.hp, but this is plain text and not html formatted:
System => Darwin imac.local 9.5.0 Darwin Kernel Version 9.5.0: Wed Sep 3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386 i386
Build Date => Jul 17 2008 23:00:49
Configure Command => '/SourceCache/apache_mod_php/apache_mod_php-44.1/php/configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--with-apxs2=/usr/sbin/apxs' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr' '--enable-trans-sid' '--with-xml' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-dbx' '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' '--with-mysql-sock=/var/mysql' '--with-mysqli=/usr/bin/mysql_config' '--with-mysql=/usr' '--with-openssl' '--with-xmlrpc' '--with-xsl=/usr' '--without-pear'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc
Loaded Configuration File => (none)
PHP API => 20041225
PHP Extension => 20060613
Zend Extension => 220060519
Debug Build => no
Thread Safety => disabled
Zend Memory Manager => enabled
IPv6 Support => enabled
Registered PHP Streams => php, file, data, http, ftp, compress.zlib, https, ftps
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filters => string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*, zlib.*
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
...
Environment
Variable => Value
GATEWAY_INTERFACE => CGI/1.1
REQUEST_METHOD => GET
REQUEST_URI => /phpinfo.php
SCRIPT_NAME => /phpinfo.php
SCRIPT_FILENAME => /var/www/hiawatha/phpinfo.php
DOCUMENT_ROOT => /var/www/hiawatha
REMOTE_ADDR => 127.0.0.1
SERVER_PORT => 80
SERVER_NAME => 127.0.0.1
SERVER_PROTOCOL => HTTP/1.1
SERVER_SOFTWARE => Hiawatha v6.10
REDIRECT_STATUS => 200
HTTP_SCHEME => http
HTTP_ACCEPT => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_CHARSET => ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_ACCEPT_LANGUAGE => en-us,en;q=0.5
HTTP_HOST => localhost
HTTP_USER_AGENT => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
HTTP_RETURN_CODE => 200
...
Copying the /etc/php.ini.default to /etc/php.ini didn't help.
When I tried the next helloworld.php script:
<?php
echo "Hello world!";
/>
I got again: 500 - Internal Server Error
/var/log/hiawatha/error.log does mention:
Tue 18 Nov 2008 19:58:53 +0100|127.0.0.1|/var/www/hiawatha/helloworld.php|CGI only printed a HTTP header, no content
Now I did the same from my Eclipse PDT environment. In that I use the PHP 5.2.5 (CGI):
/Users/rene/eclipse/plugins/org.zend.php.debug.debugger.macosx_5.2.12.v20071210/resources/php5/php-cgi
Both phpinfo.php and helloworld.php work as expected.
BTW: using this plugin.org.zend..../php-cgi in the httpd.conf didn't work, error 500: no output
Trying to find a php-cgi: sudo find / -name 'php-cgi'
This only returned:
/Users/rene/eclipse/plugins/org.zend.php.debug.debugger.macosx_5.2.12.v20071210/resources/php4/php-cgi
/Users/rene/eclipse/plugins/org.zend.php.debug.debugger.macosx_5.2.12.v20071210/resources/php5/php-cgi
Looks like I just need php-cgi on my iMac. But it just isn't installed by Apple.
Looking further on the iMac, I did found /usr/sbin/php-fcgi.
The result of php-fcgi -v is:
PHP-FastCGI v6.10
Reading
http://www.hiawatha-webserver.org/howto#5.1, I configured /etc/hiawatha/php-cfgi.conf with:
PidFile = /var/run/php-fcgi.pid
Server = /usr/sbin/php-fcgi ; 127.0.0.1:2005 ; _www
Started the process with: sudo /usr/sbin/php-fcgi -k -c /etc/hiawatha/php-fcgi.conf &
But this process does end immediately.
Und jetzt?