Setting up PHP dev environment on a Centos 5.2 VM

I’m actually setting up a VMWare image from Linhost, so I installed VMWare server, gave it 1024MB of RAM, and I tried to set up Bridged networking, but couldn’t get it working, so I decided to use Apache on Windows as a Proxy.

I added my centos VM IP address to my C:/windows/system32/drivers/etc/hosts windows centos.vm

And similarly to my /etc/hosts on the VM centos centos.vm

I edited /etc/sysconfig/network and changed the hostname


I found that Apache was blocked, so I disabled SELinux, by editing /etc/selinux/config and set


and disabled the iptables firewall by typing:

chkconfig iptables off

I could have also ran “system-config-securitylevel” to specify what services to allow but I get:

sh: setenforce: command not found

(maybe it needs SELinux running)

to enable apache httpd on startup, I typed:

chkconfig --level 235 httpd on

I found some useful advice on upgrading from

And a good yum repository with PHP 5.2 for CentOS 5.2 is at

More information about using this repository is at:

I then edited my windows Apache configuration to set up the Proxy:

ProxyPass /centos http://centos.vm/
ProxyPassReverse /centos http://centos.vm/


Listen 10080
NameVirtualHost *:10080

<VirtualHost *:10080>
 ServerName centos.vm
 ServerAlias windows
 ProxyPass / http://centos.vm/
 ProxyPassReverse / http://centos.vm/

Now I can access it two different ways, either from the path via the Windows server, or as a VirtualHost via an alternate port (10080).

Now to upgrade PHP to version 5.2 (which is not available on the official CentOS 5.2 repository), follow directions at

create a yum repository at /etc/yum.repos.d/utterramblings.repo

name=Jason's Utter Ramblings Repo

install the gpg key:

rpm --import

Then run:

yum update
 apr.i386 0:1.3.8-1.jason.1             apr-devel.i386 0:1.3.8-1.jason.1       apr-util.i386 0:1.3.9-1.jason.1         apr-util-devel.i386 0:1.3.9-1.jason.1
 httpd.i386 0:2.2.14-jason.1            httpd-devel.i386 0:2.2.14-jason.1      httpd-manual.i386 0:2.2.14-jason.1      mod_perl.i386 0:2.0.4-7.jason.1
 mod_python.i386 0:3.3.1-8.jason.1      mod_ssl.i386 1:2.2.14-jason.1          mysql.i386 0:5.0.86-jason.2             mysql-server.i386 0:5.0.86-jason.2
 pcre.i386 0:7.8-1.jason.1              php.i386 0:5.2.11-jason.1              php-cli.i386 0:5.2.11-jason.1           php-common.i386 0:5.2.11-jason.1
 php-devel.i386 0:5.2.11-jason.1        php-gd.i386 0:5.2.11-jason.1           php-imap.i386 0:5.2.11-jason.1          php-ldap.i386 0:5.2.11-jason.1
 php-mysql.i386 0:5.2.11-jason.1        php-odbc.i386 0:5.2.11-jason.1         php-pdo.i386 0:5.2.11-jason.1           php-pear.noarch 1:1.7.2-2.jason.1
 php-xml.i386 0:5.2.11-jason.1          php-xmlrpc.i386 0:5.2.11-jason.1

install APC

pecl install apc
yum install php-apc

see also

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s