Thanks to a news item and a patch from this website, I was able to build and install PHP 5.3.3 from source with no troubles. Unfortunately, it does not seem to be working. HTML pages from both localhost and my virtual host load fine, but PHP pages do not, including a phpinfo() page. All I see in both Safari and Firefox is a blank page. I've checked my error logs, but they are empty. Everything in the various httpd conf files looks good - again, the virtual host is working just fine. Previously, when there has been a problem with the PHP module, I got a detailed linker error message when I ran apachectl configtest. But with this latest build, there are no errors.
I think I've covered all the basics, but I'm willing to explore any suggestions or solutions. Thanks in advance for your time. My primary goal in recompiling PHP is to get PostgreSQL support.
FYI, I'm running Snow Leopard on a 32-bit processor, if that changes anything.
Blank pages usually means that the PHP is not parsed. Could be many things wrong. Did you compile everything in 32 bits, no warnings or errors in any of the logs, are the AddType lines added ?
What happens if you re-install 5.3.2, without changing the config, will it work again? Then something went wrong with the compilation, try it again.
lholcombe 02 Aug 2010
The Add Type lines are in a file called php5.conf, which is included in the httpd.conf. All the directives in php5.conf are enclosed by IfModule tags.
apachectl -t -D DUMP_MODULES shows that the module is in fact being loaded into Apache with no problems.
Have you tested this configuration with 5.3.2? I've got 5.3.3 running on a test server without problems. If it loads without a problem then it looks like a config problem.
lholcombe 03 Aug 2010
I haven't had any success with 5.3.2. It built with no errors, but then apachectl would refuse to load the module because of a libiconv incompatibility.
Strange, had no problem whatsoever with 5.3.2. Do you have anything like macports or fink installed? Those might interfere...
lholcombe 04 Aug 2010
Okay, I was able to successfully build 5.3.2 today, but I still get a blank screen, in both Safari and Firefox. If it helps, here's the configure script I used:
If this also results in a blank screen there is definitely something wrong with the configuration of Apache. Could you move the AddType statements directly into the httpd.conf just to see if it works. There might be a problem with the ifmodule.
lholcombe 04 Aug 2010
Unfortunately, that didn't make any difference.
Perhaps I should mention that I am using the default version of Apache, not a rebuilt version. Is there anything specifically wrong with the version included in Snow Leopard?
Not that I know of, you are the first to complain.
lholcombe 06 Aug 2010
Well, it's not Apache itself. I just installed 2.2.16 using the Darwin layout, and PHP is still not working. It must be some setting somewhere, but I can't think of where to look.
What I usually do in cases like this is to go back to the default configuration and step by step add my changes and test every change if it still works. Usually that points to the problem.
lholcombe 13 Aug 2010
Well, I may never know exactly what happened. I finally decided that the only thing to do was clean up and start over - which meant reinstalling Snow Leopard. After installing MySQL and PostgreSQL, I was able to build php-5.3.3 from source with no troubles, using the patch I found here. So everything works now. I guess after all my previous failures with MacPorts and library upgrades, the whole system was fatally broken. Lesson learned. Here's my final configure directive:
01 Aug 2010
Thanks to a news item and a patch from this website, I was able to build and install PHP 5.3.3 from source with no troubles. Unfortunately, it does not seem to be working. HTML pages from both localhost and my virtual host load fine, but PHP pages do not, including a phpinfo() page. All I see in both Safari and Firefox is a blank page. I've checked my error logs, but they are empty. Everything in the various httpd conf files looks good - again, the virtual host is working just fine. Previously, when there has been a problem with the PHP module, I got a detailed linker error message when I ran apachectl configtest. But with this latest build, there are no errors.
I think I've covered all the basics, but I'm willing to explore any suggestions or solutions. Thanks in advance for your time. My primary goal in recompiling PHP is to get PostgreSQL support.
FYI, I'm running Snow Leopard on a 32-bit processor, if that changes anything.
01 Aug 2010
Blank pages usually means that the PHP is not parsed. Could be many things wrong. Did you compile everything in 32 bits, no warnings or errors in any of the logs, are the AddType lines added ?
What happens if you re-install 5.3.2, without changing the config, will it work again? Then something went wrong with the compilation, try it again.
02 Aug 2010
The Add Type lines are in a file called php5.conf, which is included in the httpd.conf. All the directives in php5.conf are enclosed by IfModule tags.
apachectl -t -D DUMP_MODULES shows that the module is in fact being loaded into Apache with no problems.
02 Aug 2010
Have you tested this configuration with 5.3.2? I've got 5.3.3 running on a test server without problems. If it loads without a problem then it looks like a config problem.
03 Aug 2010
I haven't had any success with 5.3.2. It built with no errors, but then apachectl would refuse to load the module because of a libiconv incompatibility.
03 Aug 2010
Strange, had no problem whatsoever with 5.3.2. Do you have anything like macports or fink installed? Those might interfere...
04 Aug 2010
Okay, I was able to successfully build 5.3.2 today, but I still get a blank screen, in both Safari and Firefox. If it helps, here's the configure script I used:
sudo ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/private/etc --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-libxml-dir=/usr --with-openssl=/usr --with-kerberos=/usr --with-zlib=/usr --enable-bcmath --with-bz2=/usr --enable-calendar --with-curl=/usr --enable-exif --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --enable-gd-native-ttf --with-ldap=/usr --enable-mbstring --enable-mbregex --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iodbc=/usr --enable-shmop --with-snmp=/usr --enable-soap --with-pear --enable-sockets --enable-sysvsem --enable-sysvmsg --enable-sysvshm --with-xmlrpc --with-iconv-dir=/usr --with-xsl=/usr --with-pcre-regex --with-pgsql=/Library/PostgreSQL/8.4/bin04 Aug 2010
If this also results in a blank screen there is definitely something wrong with the configuration of Apache. Could you move the AddType statements directly into the httpd.conf just to see if it works. There might be a problem with the ifmodule.
04 Aug 2010
Unfortunately, that didn't make any difference.
Perhaps I should mention that I am using the default version of Apache, not a rebuilt version. Is there anything specifically wrong with the version included in Snow Leopard?
05 Aug 2010
Not that I know of, you are the first to complain.
06 Aug 2010
Well, it's not Apache itself. I just installed 2.2.16 using the Darwin layout, and PHP is still not working. It must be some setting somewhere, but I can't think of where to look.
07 Aug 2010
What I usually do in cases like this is to go back to the default configuration and step by step add my changes and test every change if it still works. Usually that points to the problem.
13 Aug 2010
Well, I may never know exactly what happened. I finally decided that the only thing to do was clean up and start over - which meant reinstalling Snow Leopard. After installing MySQL and PostgreSQL, I was able to build php-5.3.3 from source with no troubles, using the patch I found here. So everything works now. I guess after all my previous failures with MacPorts and library upgrades, the whole system was fatally broken. Lesson learned. Here's my final configure directive:
sudo ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/private/etc --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-libxml-dir=/usr --with-openssl=/usr --with-kerberos=/usr --with-zlib=/usr --enable-bcmath --with-bz2=/usr --enable-calendar --with-curl=/usr --enable-exif --enable-ftp --with-ldap=/usr --enable-mbstring --enable-mbregex --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-iodbc=/usr --enable-soap --with-pear --with-iconv-dir=/usr --with-xsl=/usr --with-pcre-regex --with-pgsql=/Library/PostgreSQL/8.4/binThanks for the assistance.