Issue :

Compiling PHP5 with mysql & mysqli support

Solution :

First , locate mysql_config.

$ locate mysql_config

When you run the configure command use following options :-

./configure –with-mysql=/usr –with-mysqli=/usr/bin/mysql_config

The path that goes after –with-mysql= is /usr (or whatever is two directories above mysql_config)
& path that should be given for –with-mysqli should be the path to mysql_config.

This configure command actually generates a bad Makefile. So, use a text editor and open the Makefile and look for a line that starts with EXTRA_LIBS . For example :

EXTRA_LIBS -lcrypt -lcrypt -lmysqlclient -lpng -lz -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lmysqlclient -lcrypt -lnsl -lm -lz -lnss_files -lnss_dns -lresolv -lnss_files -lnss_dns -lresolv -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lcrypt

You will see that the option “-lmysqlclient” is repeated twice. Delete one of them and save the Makefile.

Now, you should be able to run Make and compile PHP without any issues.

Contact Us On WhatsApp