Bug 167984 - [PATCH] lang/php5: Fix wrong PHP_EXT_DIR / ZEND_MODULE_API_NO
Summary: [PATCH] lang/php5: Fix wrong PHP_EXT_DIR / ZEND_MODULE_API_NO
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Dupre
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-16 23:10 UTC by Bryan Drewery
Modified: 2015-07-01 21:33 UTC (History)
1 user (show)

See Also:


Attachments
patch-php-ext-api.txt (262 bytes, patch)
2012-05-16 23:10 UTC, Bryan Drewery
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Drewery 2012-05-16 23:10:01 UTC
	The updated lang/php5 port with 5.4.3 is actually installing extensions to the 20100525 directory, but the bsd.php.mk is using 20100412.

	For example, when building www/phpmyadm, it checks for converters/php5-mbstring existing with 20100412
		===>    Verifying install for /usr/local/lib/php/20100412/mbstring.so in /usr/ports/converters/php5-mbstring

	However, the actual extension was installing to:
		/usr/local/lib/php/20100525/mbstring.so

Fix: Took 20100525 from Zend/zend_modules.h
	./work/php-5.4.3/Zend/zend_modules.h:#define ZEND_MODULE_API_NO 20100525
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-05-16 23:10:16 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Alex Dupre freebsd_committer freebsd_triage 2012-05-17 06:49:42 UTC
State Changed
From-To: open->feedback

PHP_EXT_DIR is taken from PHP_API_VERSION, not ZEND_MODULE_API_NO. 
Probably you have a screwed up installation, remove all PHP ports, 
delete /usr/local/include/php and reinstall again.
Comment 3 Bryan Drewery 2012-05-17 20:11:03 UTC
Yes I think you are correct. I've been unable to recreate this myself
after more testing.

I wiped everything and rebuilt and it all seems fine.

Also, I see that if /usr/local/etc/php.conf exists it is using
php-config to find the directory, so my patch doesn't help anyway.

You can close this.

Thanks,
Bryan Drewery
Comment 4 Alex Dupre freebsd_committer freebsd_triage 2012-05-17 21:45:35 UTC
State Changed
From-To: feedback->closed

Closed.
Comment 5 Bryan Drewery 2012-05-23 23:38:19 UTC
I actually think this is still needed and have found an easy way to
reproduce the problem.

Normally, if php is already installed (checking for
/usr/local/etc/php.conf), it will run `php-config --extension-dir` to
find the directory. If it is not installed, it falls back on PHP_EXT_DIR
in bsd.php.mk.

On every installation I've done with php54 the extension dir is coming
out as the Zend API of 20100525 and *not* 20100412. This creates an
invalid RUN_DEPENDS for ports if PHP is not installed (yet).

You can easily see the problem if you create a new jail, mount ports,
then try to install databases/phpmyadmin without having PHP already
installed.

    9# make -C /usr/ports/databases/phpmyadmin -VPHP_EXT_DIR
    20100412
    9# make -C /usr/ports/databases/phpmyadmin -VRUN_DEPENDS
    /usr/local/include/php/main/php.h:/usr/ports/lang/php5
/usr/local/lib/php/20100412/ctype.so:/usr/ports/textproc/php5-ctype
/usr/local/lib/php/20100412/session.so:/usr/ports/www/php5-session
/usr/local/lib/php/20100412/filter.so:/usr/ports/security/php5-filter
/usr/local/lib/php/20100412/mbstring.so:/usr/ports/converters/php5-mbstring
/usr/local/lib/php/20100412/json.so:/usr/ports/devel/php5-json
/usr/local/lib/php/20100412/bz2.so:/usr/ports/archivers/php5-bz2
/usr/local/lib/php/20100412/gd.so:/usr/ports/graphics/php5-gd
/usr/local/lib/php/20100412/openssl.so:/usr/ports/security/php5-openssl
/usr/local/lib/php/20100412/pdf.so:/usr/ports/print/pecl-pdflib
/usr/local/lib/php/20100412/zlib.so:/usr/ports/archivers/php5-zlib
/usr/local/lib/php/20100412/mcrypt.so:/usr/ports/security/php5-mcrypt
/usr/local/lib/php/20100412/mbstring.so:/usr/ports/converters/php5-mbstring
/usr/local/lib/php/20100412/zip.so:/usr/ports/archivers/php5-zip
/usr/local/lib/php/20100412/apc.so:/usr/ports/www/pecl-APC
/usr/local/lib/php/20100412/mysqli.so:/usr/ports/databases/php5-mysqli
    9# make -C /usr/ports/lang/php5 install
    <snip>
    9# make -C /usr/ports/databases/phpmyadmin -VPHP_EXT_DIR
    20100525
    9# php-config --extension-dir
    /usr/local/lib/php/20100525
    9# make -C /usr/ports/databases/phpmyadmin -VRUN_DEPENDS
    /usr/local/include/php/main/php.h:/usr/ports/lang/php5
/usr/local/lib/php/20100525/ctype.so:/usr/ports/textproc/php5-ctype
/usr/local/lib/php/20100525/session.so:/usr/ports/www/php5-session
/usr/local/lib/php/20100525/filter.so:/usr/ports/security/php5-filter
/usr/local/lib/php/20100525/mbstring.so:/usr/ports/converters/php5-mbstring
/usr/local/lib/php/20100525/json.so:/usr/ports/devel/php5-json
/usr/local/lib/php/20100525/bz2.so:/usr/ports/archivers/php5-bz2
/usr/local/lib/php/20100525/gd.so:/usr/ports/graphics/php5-gd
/usr/local/lib/php/20100525/openssl.so:/usr/ports/security/php5-openssl
/usr/local/lib/php/20100525/pdf.so:/usr/ports/print/pecl-pdflib
/usr/local/lib/php/20100525/zlib.so:/usr/ports/archivers/php5-zlib
/usr/local/lib/php/20100525/mcrypt.so:/usr/ports/security/php5-mcrypt
/usr/local/lib/php/20100525/mbstring.so:/usr/ports/converters/php5-mbstring
/usr/local/lib/php/20100525/zip.so:/usr/ports/archivers/php5-zip
/usr/local/lib/php/20100525/apc.so:/usr/ports/www/pecl-APC
/usr/local/lib/php/20100525/mysqli.so:/usr/ports/databases/php5-mysqli

As you can see, the RUN_DEPENDS have changed just by installing PHP. The
impact of this is that by not having PHP already installed, and going
straight to something that depends on PHP and extensions, it will keep
the PHP_EXT_DIR=20100412 in its environment, and expect the extensions
to be there later, when they really are in 20100525.

    9# pkg_delete -af
    9# make -C /usr/ports/databases/phpmyadmin -VPHP_EXT_DIR
    20100412
    9# make -C /usr/ports/databases/phpmyadmin install
    <snip>
    ===>   phpMyAdmin-3.5.1 depends on file:
/usr/local/lib/php/20100412/ctype.so - not found
    ===>    Verifying install for /usr/local/lib/php/20100412/ctype.so
in /usr/ports/textproc/php5-ctype
    ^C
    9# pkg_info -L php5-ctype-5.4.3|grep lib
    /usr/local/lib/php/20100525/ctype.so

You can see here that the RUN_DEPENDS does not match the actual
installed file.

Of course, now that PHP is installed, running -VPHP_EXT_DIR, or make
install on phpmyadmin, properly uses the 20100525 API.

This is causing problems when building packages with
ports-mgmt/poudriere with ports-mgmt/pkgng, since files are not being
installed where expected.


Regards,
Bryan Drewery
Comment 6 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2012-05-24 17:00:57 UTC
State Changed
From-To: closed->open

The originator reports that the problem still exists, and I have 
experienced it myself while trying to build www/horde-base.
Comment 7 Alex Dupre freebsd_committer freebsd_triage 2012-05-24 22:01:45 UTC
State Changed
From-To: open->closed

Fixed, thanks.
Comment 8 dfilter service freebsd_committer freebsd_triage 2012-05-24 22:01:50 UTC
ale         2012-05-24 21:01:35 UTC

  FreeBSD ports repository

  Modified files:
    Mk                   bsd.php.mk 
  Log:
  Fix PHP_EXT_DIR.
  
  PR:             ports/167984
  Submitted by:   "Bryan Drewery" <bryan@shatow.net>
  
  Revision  Changes    Path
  1.71      +2 -2      ports/Mk/bsd.php.mk
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"