There is a problem if we install PHP from source, i.e: when we need to recompile due to a new version we should reapply the old configure parameter. Forgetting to enable some features often means break our web application which depends to the feature, however it is also hard memorizing what parameters we passed to the configure command as we do not often compiling the PHP.
Fortunately, there is an easy way. Here it goes:
- Download the newest php source, here is the newest version (5.3.9) as I wrote this blog:
http://www.php.net/get/php-5.3.9.tar.bz2/from/a/mirror -
Extract the php source:
bambang@bambang-notebook:~/Downloads/php$ tar -xf php-5.3.9.tar.gz
bambang@bambang-notebook:~/Downloads/php$ cd php-5.3.9
bambang@bambang-notebook:~/Downloads/php/php-5.3.9$
- Write a phpinfo.php to your web server document folder. The content of the script:
<html>
<head>
</head>
<body>
<?php echo phpinfo(); ?>
</body>
</html>
- Open the phpinfo.php above in your browser:
Notice the configure command on the third row, block and copy the configure command - Go back to your terminal in the step 2, and paste the command and press enter:
bambang@bambang-notebook:~/Downloads/php/php-5.3.9$ './configure' '--with-apxs2=/usr/bin/apxs2' '--with-interbase=/opt/firebird' '--enable-sockets' '--with-pear' '--with-gd' '--with-mysql=/usr/bin/mysql_config' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-soap' '--enable-libxml' '--enable-calendar' '--with-pdo-firebird=/opt/firebird'
- After this step, you simply run make and sudo make install to upgrade your php.
Comments
Post a Comment