FreeBSD pkg_add: warning: package php5-pcre-5.2.6_2 requires php5-5.2.8, but php5-pcre-5.2.6_2 is installed

Posted on in Categories , , , , last updated December 22, 2008

Q. I’m trying to upgrade my PHP version from 5.2.6 to 5.2.8 using portupgrade command. But I’m getting following errors:

*** Error code 1

Stop in /usr/ports/lang/php5.
*** Error code 1

Stop in /usr/ports/lang/php5.
*** Error code 1

Stop in /usr/ports/lang/php5.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade.42275.0 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=php5-pcre-5.2.6_2 UPGRADE_PORT_VER=5.2.6_2 make reinstall
—> Restoring the old version
pkg_add: warning: package ‘php5-pcre-5.2.6_2’ requires ‘php5-5.2.8’, but ‘php5-pcre-5.2.6_2’ is installed
** Fix the installation problem and try again.
[Updating the pkgdb in /var/db/pkg … – 62 packages found (-0 +1) . done]
** Listing the failed packages (-:ignored / *:skipped / !:failed)
! lang/php5 (php5-pcre-5.2.6_2) (install error)

How do I fix this problem and upgrade php5-pcre?

FreeBSD Lighttpd fastcgi php configuration and installation

Posted on in Categories , last updated June 30, 2007

Q. How do I install and configure php under Lighttpd web server. I’m using

=> FreeBSD 6.2

=> Lighttpd 1.5

=> FastCGI PHP 5.2

How do I configure php under Lighttpd?

A. PHP generally runs on a web server like lighttpd taking PHP code as its input and creating Web pages as output. FastCGI is a protocol for interfacing interactive programs with a web server. Lighttpd has mod_fastcgi to run php application.

Assuming that you have php installed (see these instructions on installing Lighttpd+MySQL+php5 under FreeBSD), open lighttpd.conf file:
# vi /usr/local/etc/lighttpd.conf
Make sure FASTCGI module is enabled:
server.modules += ( "mod_fastcgi" )

Now append following code

fastcgi.server = ( ".php" =>
( "localhost" =>
                        "socket" => "/tmp/php-fastcgi.socket",
                        "bin-path" => "/usr/local/bin/php-cgi"

Save and close the file. Restart lighttpd:
# /usr/local/etc/rc.d/lighttpd restart

Install PHP 5 in Red Hat Enterprise Linux 5

Posted on in Categories , , last updated July 30, 2007

Q. I saw your earlier article about how to install PHP 5 under Red Hat Enterprise Linux version 4. But I’m using Red Hat enterprise Linux 5 and I don’t want to mess up with old version instructions. Is there a way that I can install PHP5 under RHEL 5 without using source rpm?

A. Redhat Enterprise 5 supports PHP version 5 out of box. You can install PHP 5 using any one of the following method:

Method #1: Download and install php 5 from RHN

Type the following command to install php 5:
# yum install php
You may also want to install Apache and other php 5 extensions:
# yum install httpd php-gd php-mysql

Method #2: CD/DVD

Mount CD/DVD rom and use rpm command to install PHP5:
# rpm -ivh php*

Method #3: Use GUI package manager

Type the following command to start GUI package manager:
# system-config-package
Now Select PHP (under Web Servers) and install the same.