# Version Conflicts with PHP Port Upgrade & MySQL DB Extensions



## rtwingfield (Jul 14, 2011)

EDIT NOTES (blue typeface):  

This four year old paragraph is related to my current post below.  Problem now is with installation of php5.6.

There were several exacerbating situations that compounded the difficulty of identifying and solving the problems.  I have generated about nineteen pages of notes in a WordPerfect text file.  After I decompress, I will summarize the solution and post updates for your information.

===============

I have updated my ports (all) trying both cvsup and portsnap.

I'm having difficulty synchronizing the make of php52 and php52-extensions.  At one point, phpinfo() revealed that php v5.3+ was installed . . .how I don't know unless it had something to do with a recent port install of Samba and OpenLDAP (it was spooky to watch changes ported regarding both MySQL and PHP).  Regardless, once Apache v2.2.11 was eventually restarted, things like phpMyAdmin, ZenPhoto, and WebCalendar . . .all dependent on the MySQL backend engine, now fail with numerous messages similar to the following:


```
Unknown(0) : Warning - PHP Startup: openssl: Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=1, thread-safety=0
These options need to match

Unknown(0) : Warning - PHP Startup: PDO: Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=1, thread-safety=0
These options need to match

. . .[I]and notice the diffirent API dates regarding the following:[/I]

Unknown(0) : Warning - PHP Startup: SimpleXML: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
```

*First Question*:  In consideration that I'm running FreeBSD v7.2, is that precluding the port download of php53 . . .I can only download php52 and the php52-extensions. I cannot find php53 in the ports tree.  (see http://www.freebsd.org/ports/master-index.html) This should have nothing to do with the FreeBSD OS version.

I've deinstalled and remade (numerous times) both php52 and php52-extensions, but the problem persists. (See URL in following Second Question.)

*Second Question*:  Are the messages suggesting that the debug level, i.e., options, need to be the same?  If that is the case, then perhaps I can recompile one or the other to the same debug level, but what about the second scenario where the API dates are different?  Yes, the debug levels were part of the problem; however, the out-of-sysc versions needed to be resolved; see this thread:  http://forums.freebsd.org/showthread.php?t=25082 regarding php53 Port Status.

*Third Question*  Otherwise, why does my updated ports tree not include php53? (See URL in preceding Second Question.)

*In conclusion* (for now), I know that there is a lot of lobbying (see http://forums.freebsd.org/showthread.php?t=15799)to use the _ports upgrade all_scenario, yet, the thought of trusting the process to cover all bases just leaves me _uncomfortable_.  What about an upgrade/all that has no knowledge of a non-FreeBSD port application? (rhetorical question); never-the-less, perhaps I shall read up on the process.


----------



## rtwingfield (Jun 22, 2015)

. . .back again, four years later and similar problem yet again.
The current OS is FreeBSD 10.1-RELEASE-p10

The following are installed:

```
php56-5.6.10  PHP Scripting Language
/usr/local/lib/php/20131226
php56-mysql-5.6.10  The mysql shared extension for php
php56-pdo-5.6.10  The pdo shared extension for php
php56-pdo_mysql-5.6.10  The pdo_mysql shared extension for php
```

I have used `pkg delete php56` to (I assume) completely remove the php56 port and followed with `portmaster` to reinstall the port and the associated php56-pdo_mysql-5.6.10.  Apparently the extension modules are compiled with API=20131226 while the core of php56 is stuck at API=20060613.

From the httpd-error.log:


```
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20131226/pdo.so' - /usr/local/lib/php/20131226/pdo.so: Undefined symbol &quot;zend_new_interned_string&quot; in Unknown on line 0
PHP Warning:  PHP Startup: mysql: Unable to initialize module\nModule compiled with module API=20131226, debug=0, thread-safety=0\nPHP  compiled with module API=20060613, debug=0, thread-safety=0\n[B]These options need to match[/B]\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20131226/pdo_mysql.so' - /usr/local/lib/php/20131226/pdo_mysql.so: Undefined symbol &quot;mysqlnd_allocator&quot; in Unknown on line 0
```

So, how do I recompile to bring the core php56 up to "date" with API=20131226.  Is there an obscure MAKEFILE argument somewhere that will accomplish this?

Also, what's with the "undefined symbol" complaints???

How do I re-run `make` to prompt for the config arguments?


----------



## SirDice (Jun 22, 2015)

Please read /usr/ports/UPDATING:

```
20150220:
  AFFECTS: users of PHP

  The default PHP version has been updated from 5.4 to 5.6.

  If you use binary packages you should make a list of php packages
  before running 'pkg upgrade':

  # pkg info php5\* > ~/installed-php-ports-list

  After the upgrade, check with such list if all your php extensions
  are still installed, and reinstall them if needed.
```


----------



## rtwingfield (Jun 22, 2015)

SirDice said:


> Please read /usr/ports/UPDATING:
> 
> ```
> 20150220:
> ...



. . .have already read /usr/ports/UPDATING.  Perhaps there is confusion because I've reused a four year old _similar_ post that I started.  I have currently installed php5.6 but for some reason, the version as install seems to _think_ that it was . . .


rtwingfield said:


> compiled with module API=20060613



This from `pkg info`:

```
php56-5.6.10  PHP Scripting Language
php56-bz2-5.6.10  The bz2 shared extension for php
php56-mysql-5.6.10  The mysql shared extension for php
php56-pdo-5.6.10  The pdo shared extension for php
php56-pdo_mysql-5.6.10  The pdo_mysql shared extension for php
```

. . .so, where does the API=20060613 come from?


----------

