Home > PHP

Posts in PHP

Add Zip Support

July 29, 2011 Posted in PHP

According to the PHP manual, zip extension uses the functions of zlib (archivers/php5-zlib), but it doesn’t work. Actually there is a separated package dedicated to zip support: archivers/php5-zip, after I installed this package, phpinfo() will have a zip section. Isn’t that confusing?

Upgrading PHP 5.2 to 5.3 – Bad Move

September 5, 2010 Posted in PHP

Update: please see my new post: PHP 5.3 Isn’t That Bad

MediaWiki doesn’t like PHP 5.2.8, I had to upgrade PHP to install MediaWiki. PortUpgrade upgraded PHP to 5.3.3 successfully, but it got problems while upgrading PHP modules, it’s mainly caused by the change of PCRE package which became part of PHP on FreeBSD since 5.3. If you need to upgrade to PHP 5.3.x, make sure you read /usr/ports/UPDATING and this thread.
Read More

Upgrade to PHP 5 and MySQL 5

March 8, 2008 Posted in PHP

There is really no any reason to continue using PHP 4 and MySQL 4 except being lazy. The upgrade was quite smooth and took about 1.5 hours including compiling time. Read More

Add GD Support for PHP

February 15, 2006 Posted in PHP

To enable image (JPEG/PNG) manipulation for PHP, install gd extension from ports:

# cd /usr/ports/graphics/php4-gd
# make install clean
# apachectl graceful
Read More

PHP Upgrade

February 15, 2006 Posted in PHP

Upgrading PHP may affect installed PHP modules. For example, a PHP script reported the following error after I upgraded PHP:

PHP Warning: Unknown(): Unable to load dynamic library ‘/usr/local/lib/php/20020429/xml.so’ – Shared object "libexpat.so.5" not found, required by "xml.so" in Unknown on line 0

Reinstalling /usr/ports/textproc/php4-xml fixed it.

Mambo Revisited

February 15, 2006 Posted in PHP

I tried Mambo a while ago and it’s always causing a fatal error “httpd exited on signal 11“. Read More

Httpd Exited on Signal 11 – Caused by Buggy Script

July 31, 2005 Posted in Apache, PHP

My security run output of today contains lots of error messages like:
pid 90742 (httpd), uid 80: exited on signal 11
pid 90896 (httpd), uid 80: exited on signal 11
Read More

PHP Debugging

July 22, 2005 Posted in PHP

When something strange happens to a third-party PHP script, I often have no idea where to start to fix the problems. I find PHP code debugging is an effective way even the error message may suggest a system configuration problem. Read More

Execute Commands in PHP

June 24, 2005 Posted in PHP

Sometimes I login to the server only for running a simple command, such as uptime. It can be more convenient to do this with a simple PHP page, for example, the following code will display the the output of uptime command:

<?php passthru("uptime"); ?>

For more details about how to execute Unix/Linux command in PHP, please refer to PHP online manual.

Two PHP Problems

April 2, 2005 Posted in PHP

This is probably very simple, but I could spend hours on it if I’m not lucky. Read More

register_globals

January 15, 2005 Posted in PHP

In my last post, I wrote: “PHP doesn’t need any configuration if installed with pkg_add”, well, this is not accurate, I found several php scripts worked weird, that reminded me of the famous parameter register_globals. It’s off by default, pkg_add doesn’t create php.ini, if you want to enable register_globals, you have to create a php.ini and modify the configuration, then restart Apache. Read More



Archives