Bug 1124605

Summary: Incorrect "--php-binary" from /usr/bin/zts-php-config
Product: [Fedora] Fedora Reporter: Shawn Iwinski <shawn>
Component: phpAssignee: Remi Collet <fedora>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fedora, jorton
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: php-5.5.16-1.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-02 06:40:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Shawn Iwinski 2014-07-29 22:03:22 UTC
Description of problem: When building C/PECL extensions for ZTS, the PHP binary from /usr/bin/zts-php-config is incorrect which results in "make test" for ZTS to skip tests because ZTS compiled module could not be loaded with NTS binary.

Version-Release number of selected component (if applicable):

How reproducible:
View /usr/bin/zts-php-config output

Steps to Reproduce (example spec file where issue was noticed):
1. wget https://raw.githubusercontent.com/siwinski/rpms/master/php-pimple.spec
2. spectool -g -R php-pimple.spec
3. rpmbuild -ba php-pimple.spec

Actual results:
* ZTS tests from "make test" skipped (module not loaded)
* From /usr/bin/zts-php-config output:   --php-binary        [/usr/bin/php]

Expected results:
* ZTS tests from "make test" not skipped (module should load)
* From /usr/bin/zts-php-config output:   --php-binary        [/usr/bin/zts-php]

Additional info:

Koji scratch build with skipped ZTS tests: http://koji.fedoraproject.org/koji/taskinfo?taskID=7211582
(search for "Tests skipped")

$ /usr/bin/zts-php-config 
Usage: /usr/bin/zts-php-config [OPTION]
  --prefix            [/usr]
  --includes          [-I/usr/include/php-zts/php -I/usr/include/php-zts/php/main -I/usr/include/php-zts/php/TSRM -I/usr/include/php-zts/php/Zend -I/usr/include/php-zts/php/ext -I/usr/include/php-zts/php/ext/date/lib]
  --ldflags           []
  --libs              [-lcrypt   -lresolv -lcrypt -ledit -lncurses -lstdc++ -lz -lpcre -lrt -lm -ldl -lnsl  -lxml2 -lz -lm -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcrypt -lcrypt ]
  --extension-dir     [/usr/lib64/php-zts/modules]
  --include-dir       [/usr/include/php-zts/php]
  --man-dir           [/usr/share/man]
  --php-binary        [/usr/bin/php]
  --php-sapis         [ cli cgi]
  --configure-options [--build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-libdir=lib64 --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --disable-debug --with-pic --disable-rpath --without-pear --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --with-vpx-dir=/usr --enable-gd-native-ttf --with-t1lib=/usr --without-gdbm --with-jpeg-dir=/usr --with-openssl --with-pcre-regex=/usr --with-zlib --with-layout=GNU --with-kerberos --with-libxml-dir=/usr --with-system-tzdata --with-mhash --enable-dtrace --includedir=/usr/include/php-zts --libdir=/usr/lib64/php-zts --enable-maintainer-zts --with-config-file-scan-dir=/etc/php-zts.d --enable-pcntl --enable-opcache --with-imap=shared --with-imap-ssl --enable-mbstring=shared --enable-mbregex --with-gd=shared,/usr --with-gmp=shared --enable-calendar=shared --enable-bcmath=shared --with-bz2=shared --enable-ctype=shared --enable-dba=shared --with-db4=/usr --with-tcadb=/usr --with-gettext=shared --with-iconv=shared --enable-sockets=shared --enable-tokenizer=shared --enable-exif=shared --enable-ftp=shared --with-xmlrpc=shared --with-ldap=shared --with-ldap-sasl --enable-mysqlnd=shared --with-mysql=shared,mysqlnd --with-mysqli=shared,mysqlnd --with-mysql-sock=/var/lib/mysql/mysql.sock --enable-mysqlnd-threading --with-interbase=shared,/usr/lib64/firebird --with-pdo-firebird=shared,/usr/lib64/firebird --enable-dom=shared --with-pgsql=shared --enable-simplexml=shared --enable-xml=shared --enable-wddx=shared --with-snmp=shared,/usr --enable-soap=shared --with-xsl=shared,/usr --enable-xmlreader=shared --enable-xmlwriter=shared --with-curl=shared,/usr --enable-pdo=shared --with-pdo-odbc=shared,unixODBC,/usr --with-pdo-mysql=shared,mysqlnd --with-pdo-pgsql=shared,/usr --with-pdo-sqlite=shared,/usr --with-pdo-dblib=shared,/usr --with-sqlite3=shared,/usr --without-readline --with-libedit --with-pspell=shared --enable-phar=shared --with-mcrypt=shared,/usr --with-tidy=shared,/usr --with-mssql=shared,/usr --enable-sysvmsg=shared --enable-sysvshm=shared --enable-sysvsem=shared --enable-shmop=shared --enable-posix=shared --with-unixODBC=shared,/usr --enable-fileinfo=shared --enable-intl=shared --with-icu-dir=/usr --with-enchant=shared,/usr --with-recode=shared,/usr]
  --version           [5.5.15]
  --vernum            [50515]

For example of extension ZTS tests being skipped during "make test" see https://github.com/siwinski/rpms/blob/master/php-pimple.spec#L189

Comment 1 Remi Collet 2014-07-30 05:14:48 UTC
Interesting catch, and should be easy to fix.

For now, simple workaround is to used "php run-test.php" which allow to use environment variables (TEST_PHP_EXECUTABLE, TEST_PHP_ARGS, NO_INTERACTION and REPORT_EXIT_STATUS)

Comment 2 Remi Collet 2014-07-30 06:00:33 UTC
Fix proposal: add --program-prefix to configure command of ZTS build.

This will 
- fix this issue
- avoid having to rename binaries after install
- provide man pages for zts-*

Comment 3 Remi Collet 2014-07-31 06:14:13 UTC
Fixed in f21/rawhide (5.6.0RC3)

@shawn can you check if all work as expected, before I apply this change in stable branches (with php 5.5.16, expected in ~3 weeks)

Comment 4 Shawn Iwinski 2014-08-04 14:29:13 UTC
Works great for me.  Thanks!

Comment 5 Fedora Update System 2014-08-21 08:06:50 UTC
php-5.5.16-1.fc19 has been submitted as an update for Fedora 19.

Comment 6 Fedora Update System 2014-08-21 08:06:56 UTC
php-5.5.16-1.fc20 has been submitted as an update for Fedora 20.

Comment 7 Fedora Update System 2014-08-23 01:56:13 UTC
Package php-5.5.16-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing php-5.5.16-1.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2014-09-02 06:40:36 UTC
php-5.5.16-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2014-09-02 06:47:42 UTC
php-5.5.16-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.