Installing PHP 5.2 from source

I’m trying to install PHP 5.2.11 on my system. I’m running OpenSuSe 11.2. As I cannot find a package that will allow me to install this, I am trying to install it from source.

I already installed Apache2, and MySQL through YaST. I also installed the libxml2 package, and the apache2-devel packages.

I download the php 5.2.11 tar.bz2 file and ran the following.

./configure --prefix=/usr/local/php --with-apxs2=/usr/sbin/apxs2 --with-mysql=/usr/bin/mysql --with-libxml-dir=/usr/lib/

Everything seemed to be going fine until I got the following error message

configure: error: Cannot find MySQL header files under /usr/lib/.

Does anyone know what I am doing wrong. I need php 5.2 and can’t use 5.3 as the application I am using is incompatible with it (it’s called Drupal)


You probably need the mysql-devel package.

Yeah, what I’ve seen is that drupal fell foul of the changes in 5.3. Maybe if you pester drupal a bit they might fix it for 5.3 and save everybody a lot of work.

That is what I had assumed, but I was unable to locate the package mysql-devel. I looked in the build service, and did a webpin search of my repositories. Any idea where I may find this elusive package?



They do plan to make it work with PHP 5.3. But they plan to make drupal 7 work with PHP 5.3, and that will take a while to be released.


Searching with zypper I see a package libmysqld-devel which is probably what you need.

BTW if you don’t find the package under the expected name (mysql-devel in this case) try just searching for ‘mysql’ or whatever, you’ll usually see the -devel package in the results there.