Add MySQL support to previously-installed (MacPorts) PHP4

Ryan Schmidt ryandesign at macports.org
Thu Jan 13 11:58:19 PST 2011


On Jan 13, 2011, at 00:59, Leez wrote:

> I already have a MySQL (5) database installed (not via MacPorts), and I recently installed PHP4 + Apache2 via MacPorts.  PHP4 was compiled '--without-mysql' and I would like to add MySQL support without re-installing MySQL, or PHP4.   
> 
> (Note: I have set the mysql.default_socket in php.ini, but I still get "Call to undefined function: mysql_connect()" when trying to load PHP pages.) 
> 
> I see that I have a php5-mysql port, but no php4-mysql port.  Does this exist?  Do I need it to enable MySQL support? 

To add MySQL 5 support to php4, reinstall php4 with the +mysql5 variant (i.e. "sudo port install php4 +mysql5"). See "port variants php4" for other variants that are available.

php5 used to use variants too, but in 2009 I replaced the variants with separate ports like php5-mysql. Since php4 is obsolete, I'm not expending the effort to make the same changes there.




More information about the macports-users mailing list