Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  Request to add mariadb support for php package

    Posted Thu January 09, 2020 01:27 PM

    Originally posted by: Gusb


    Hello Team,

    I need to use a LAMP environment on AIX using packages downloaded from AIX toolbox. Then to use dynamic pages content we are using php and connection to a db. Also I downloaded mariadb from AIX toolbox

    I need connection from php to mariadb, The  mysqli.so to connect to mariadb is not available on the binary.

    I ran

    php -m

    and the result is:


    php -m
    [PHP Modules]
    Core
    ctype
    date
    dom
    fileinfo
    filter
    ftp
    hash
    iconv
    json
    ldap
    libxml
    openssl
    pcre
    PDO
    pdo_sqlite
    Phar
    posix
    Reflection
    session
    SimpleXML
    soap
    SPL
    sqlite3
    standard
    tokenizer
    xml
    xmlreader
    xmlwriter

    [Zend Modules]


    no mysqli module on php package downloaded from AIX toolbox.

     

     

    Alternatively I tried to compile the sources that are available on AIX toolbox but the compilation fails.

    I downloaded php source code from:

    https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/SRPMS/php/php-7.2.19-2.src.rpm

    by adding "--with-mysql=/opt/freeware/bin/mysql_config \ " in the .spec file

     The following is the output:


    root@c01:/opt/freeware/src/packages/SPECS>rpmbuild -ba php-7.2.19-2.spec
    warning: Macro %dotests defined but not used within scope
    warning: bogus date in %changelog: Thu Aug 31 2018 Reshma V Kumar <reskumar@in.ibm.com> 7.0.31-1
    warning: bogus date in %changelog: Thu Nov 25 2016 Nitish K Mishra <nitismis@in.ibm.com> 7.0.13-1
    warning: bogus date in %changelog: Thu Nov 26 2008 Michael Perzl <michael@perzl.org> - 5.2.8-1
    Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.q8wMea
    + umask 022
    + cd /opt/freeware/src/packages/BUILD
    + cd /opt/freeware/src/packages/BUILD
    + rm -rf php-7.2.19
    + /bin/gzip -dc /opt/freeware/src/packages/SOURCES/php-7.2.19.tar.gz
    + /bin/tar -xof -
    + STATUS=0
    + [ 0 -ne 0 ]
    + cd php-7.2.19
    + /bin/chmod -Rf a+rX,u+w,g-w,o-w .
    + echo Patch #0 (php-7.2.19-aixconfig.patch):
    Patch #0 (php-7.2.19-aixconfig.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .aixconfig --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aixconfig.patch
    patching file ext/mysqlnd/mysqlnd_result.c
    + echo Patch #2 (php-7.2.19-aix-build.patch):
    Patch #2 (php-7.2.19-aix-build.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .build --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aix-build.patch
    patching file Makefile.global
    patching file configure
    Hunk #1 succeeded at 7237 (offset 146 lines).
    Hunk #2 succeeded at 10204 (offset 1 line).
    patching file sapi/cgi/config9.m4
    patching file sapi/cli/config.m4
    + echo Patch #3 (php-7.2.19-aix-network.patch):
    Patch #3 (php-7.2.19-aix-network.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .network --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aix-network.patch
    patching file ext/standard/basic_functions.c
    Hunk #1 succeeded at 3986 (offset 31 lines).
    + echo Patch #4 (php-7.2.19-aix-setrlimit.patch):
    Patch #4 (php-7.2.19-aix-setrlimit.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .setrlimit --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aix-setrlimit.patch
    patching file ext/posix/posix.c
    + echo Patch #6 (php-7.2.19-aix-tests.patch):
    Patch #6 (php-7.2.19-aix-tests.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .tests --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aix-tests.patch
    patching file ext/soap/tests/bugs/bug29109.wsdl
    + echo Patch #7 (php-7.2.19-aix-trailing-slash.patch):
    Patch #7 (php-7.2.19-aix-trailing-slash.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .trailing-slash --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aix-trailing-slash.patch
    patching file Zend/zend_virtual_cwd.c
    Hunk #1 succeeded at 368 (offset -40 lines).
    patching file main/streams/plain_wrapper.c
    patching file Zend/zend_virtual_cwd.h
    patching file Zend/zend_virtual_cwd.c
    + echo Patch #9 (php-7.2.18-fpm.patch):
    Patch #9 (php-7.2.18-fpm.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p0 --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.18-fpm.patch
    patching file configure
    + rm -rf /tmp/php-7.2.19-32bit
    + cp -pr . /tmp/php-7.2.19-32bit
    + rm -fr CODING_STANDARDS CONTRIBUTING.md CREDITS EXTENSIONS INSTALL LICENSE Makefile.frag Makefile.gcov Makefile.global Makefile.global.build NEWS README.EXT_SKEL README.GIT-RULES README.MAILINGLIST_RULES README.NEW-OUTPUT-API README.PARAMETER_PARSING_API README.REDIST.BINS README.RELEASE_PROCESS README.SELF-CONTAINED-EXTENSIONS README.STREAMS README.SUBMITTING_PATCH README.TESTING README.TESTING2 README.UNIX-BUILD-SYSTEM README.WIN32-BUILD-SYSTEM README.input_filter README.md TSRM UPGRADING UPGRADING.INTERNALS Zend acinclude.m4 aclocal.m4 appveyor build buildconf buildconf.bat config.guess config.sub configure configure.ac configure.build ext footer generated_lists genfiles header install-sh ltmain.sh main makedist missing mkinstalldirs pear php.gif php.ini-development php.ini-production php7.spec.in run-tests.php sapi scripts server-tests-config.php server-tests.php snapshot stamp-h.in tests travis vcsclean win32
    + mv /tmp/php-7.2.19-32bit 32bit
    + cp -pr 32bit 64bit
    + exit 0
    Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.2JwMeb
    + umask 022
    + cd /opt/freeware/src/packages/BUILD
    + cd php-7.2.19
    + export CC=/opt/freeware/bin/gcc -fPIC
    + export CXX=/opt/freeware/bin/g++
    + export OBJECT_MODE=64
    + cd 64bit
    + export CFLAGS=-Wl,-bbigtoc -I/usr/include/openssl -O2 -maix64 -I/opt/freeware/include
    + export LDFLAGS=-L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -lm -lXpm -lpthread -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib
    + export PHP_LDFLAGS=-L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib -lm -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib
    + patch -p0
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-phpini.patch
    Hmm...  Looks like a unified context diff to me...
    The text leading up to this was:
    --------------------------
    |--- main/php_ini.c.orig        2019-04-29 03:09:18 +0000
    |+++ main/php_ini.c     2019-04-29 03:09:36 +0000
    --------------------------
    Patching file main/php_ini.c using Plan A...
    Hunk #1 failed at 612.
    1 out of 1 hunks failed--saving rejects to main/php_ini.c.rej
    done
    error: Bad exit status from /var/tmp/rpm-tmp.2JwMeb (%build)


    RPM build errors:
        Macro %dotests defined but not used within scope
        bogus date in %changelog: Thu Aug 31 2018 Reshma V Kumar <reskumar@in.ibm.com> 7.0.31-1
        bogus date in %changelog: Thu Nov 25 2016 Nitish K Mishra <nitismis@in.ibm.com> 7.0.13-1
        bogus date in %changelog: Thu Nov 26 2008 Michael Perzl <michael@perzl.org> - 5.2.8-1
        Bad exit status from /var/tmp/rpm-tmp.2JwMeb (%build)
    root@c01:/opt/freeware/src/packages/SPECS>

     


    Could you help me to add mariaDB support to php available on AIX toolbox?

     

    Thanks in advance.

    Gustavo.


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 2.  Re: Request to add mariadb support for php package

    Posted Fri January 10, 2020 02:26 AM

    Originally posted by: AyappanP


    Adding mariadb support to php is our priority now. We will try to deliver it this month (January). 

    Compiling it yourself involves some effort. From the error , it looks like the build uses AIX patch command. I suggest you to use /opt/freeware/bin/patch by exporting it in your PATH.

    And also you need to add the generated mysql files in the files section of the spec file. You can take a look at bull freeware php spec file.

     


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 3.  Re: Request to add mariadb support for php package

    Posted Tue February 18, 2020 02:56 PM

    Originally posted by: Gusb


    Hi

    Any news regarding about the addition mariadb support for php packages?

    Thanks in advance.

     


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 4.  Re: Request to add mariadb support for php package

    Posted Wed February 19, 2020 09:44 AM

    Originally posted by: AyappanP


    We are working on it. 


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 5.  Re: Request to add mariadb support for php package

    Posted Thu March 05, 2020 02:18 PM

    Originally posted by: Gusb


    Please tell me when the package are available.

    Thanks in advance.


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 6.  Re: Request to add mariadb support for php package

    Posted Thu March 05, 2020 03:16 PM

    Originally posted by: Gusb


    I changed PATH in order to add patch to PATH as follows

    root@c01:/opt/freeware/src/packages/SPECS>echo $PATH                        
    /opt/freeware/bin/patch:/usr/java14/jre/bin:/usr/java14/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java7_64/jre/bin:/usr/java7_64/bin:/usr/lpp/psf/bin:/usr/lpp/pd/bin:/doc1:/doc1v5:/usr/local/bin:/usr/vac/bin:.:

     

    rpmbuild -ba php-7.2.19-2.spec
    warning: Macro %dotests defined but not used within scope
    warning: bogus date in %changelog: Thu Aug 31 2018 Reshma V Kumar <reskumar@in.ibm.com> 7.0.31-1
    warning: bogus date in %changelog: Thu Nov 25 2016 Nitish K Mishra <nitismis@in.ibm.com> 7.0.13-1
    warning: bogus date in %changelog: Thu Nov 26 2008 Michael Perzl <michael@perzl.org> - 5.2.8-1
    Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.SfqMea
    + umask 022
    + cd /opt/freeware/src/packages/BUILD
    + cd /opt/freeware/src/packages/BUILD
    + rm -rf php-7.2.19
    + /bin/gzip -dc /opt/freeware/src/packages/SOURCES/php-7.2.19.tar.gz
    + /bin/tar -xof -
    + STATUS=0
    + [ 0 -ne 0 ]
    + cd php-7.2.19
    + /bin/chmod -Rf a+rX,u+w,g-w,o-w .
    + echo Patch #0 (php-7.2.19-aixconfig.patch):
    Patch #0 (php-7.2.19-aixconfig.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .aixconfig --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aixconfig.patch
    patching file ext/mysqlnd/mysqlnd_result.c
    + echo Patch #2 (php-7.2.19-aix-build.patch):
    Patch #2 (php-7.2.19-aix-build.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .build --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aix-build.patch
    patching file Makefile.global
    patching file configure
    Hunk #1 succeeded at 7237 (offset 146 lines).
    Hunk #2 succeeded at 10204 (offset 1 line).
    patching file sapi/cgi/config9.m4
    patching file sapi/cli/config.m4
    + echo Patch #3 (php-7.2.19-aix-network.patch):
    Patch #3 (php-7.2.19-aix-network.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .network --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aix-network.patch
    patching file ext/standard/basic_functions.c
    Hunk #1 succeeded at 3986 (offset 31 lines).
    + echo Patch #4 (php-7.2.19-aix-setrlimit.patch):
    Patch #4 (php-7.2.19-aix-setrlimit.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .setrlimit --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aix-setrlimit.patch
    patching file ext/posix/posix.c
    + echo Patch #6 (php-7.2.19-aix-tests.patch):
    Patch #6 (php-7.2.19-aix-tests.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .tests --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aix-tests.patch
    patching file ext/soap/tests/bugs/bug29109.wsdl
    + echo Patch #7 (php-7.2.19-aix-trailing-slash.patch):
    Patch #7 (php-7.2.19-aix-trailing-slash.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p1 -b --suffix .trailing-slash --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-aix-trailing-slash.patch
    patching file Zend/zend_virtual_cwd.c
    Hunk #1 succeeded at 368 (offset -40 lines).
    patching file main/streams/plain_wrapper.c
    patching file Zend/zend_virtual_cwd.h
    patching file Zend/zend_virtual_cwd.c
    + echo Patch #9 (php-7.2.18-fpm.patch):
    Patch #9 (php-7.2.18-fpm.patch):
    + /opt/freeware/bin/patch --no-backup-if-mismatch -p0 --fuzz=2
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.18-fpm.patch
    patching file configure
    + rm -rf /tmp/php-7.2.19-32bit
    + cp -pr . /tmp/php-7.2.19-32bit
    + rm -fr CODING_STANDARDS CONTRIBUTING.md CREDITS EXTENSIONS INSTALL LICENSE Makefile.frag Makefile.gcov Makefile.global Makefile.global.build NEWS README.EXT_SKEL README.GIT-RULES README.MAILINGLIST_RULES README.NEW-OUTPUT-API README.PARAMETER_PARSING_API README.REDIST.BINS README.RELEASE_PROCESS README.SELF-CONTAINED-EXTENSIONS README.STREAMS README.SUBMITTING_PATCH README.TESTING README.TESTING2 README.UNIX-BUILD-SYSTEM README.WIN32-BUILD-SYSTEM README.input_filter README.md TSRM UPGRADING UPGRADING.INTERNALS Zend acinclude.m4 aclocal.m4 appveyor build buildconf buildconf.bat config.guess config.sub configure configure.ac configure.build ext footer generated_lists genfiles header install-sh ltmain.sh main makedist missing mkinstalldirs pear php.gif php.ini-development php.ini-production php7.spec.in run-tests.php sapi scripts server-tests-config.php server-tests.php snapshot stamp-h.in tests travis vcsclean win32
    + mv /tmp/php-7.2.19-32bit 32bit
    + cp -pr 32bit 64bit
    + exit 0
    Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.LJqMeb
    + umask 022
    + cd /opt/freeware/src/packages/BUILD
    + cd php-7.2.19
    + export CC=/opt/freeware/bin/gcc -fPIC
    + export CXX=/opt/freeware/bin/g++
    + export OBJECT_MODE=64
    + cd 64bit
    + export CFLAGS=-Wl,-bbigtoc -I/usr/include/openssl -O2 -maix64 -I/opt/freeware/include
    + export LDFLAGS=-L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -lm -lXpm -lpthread -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib
    + export PHP_LDFLAGS=-L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib -lm -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib
    + patch -p0
    + 0< /opt/freeware/src/packages/SOURCES/php-7.2.19-phpini.patch
    Hmm...  Looks like a unified context diff to me...
    The text leading up to this was:
    --------------------------
    |--- main/php_ini.c.orig        2019-04-29 03:09:18 +0000
    |+++ main/php_ini.c     2019-04-29 03:09:36 +0000
    --------------------------
    Patching file main/php_ini.c using Plan A...
    Hunk #1 failed at 612.
    1 out of 1 hunks failed--saving rejects to main/php_ini.c.rej
    done
    error: Bad exit status from /var/tmp/rpm-tmp.LJqMeb (%build)


    RPM build errors:
        Macro %dotests defined but not used within scope
        bogus date in %changelog: Thu Aug 31 2018 Reshma V Kumar <reskumar@in.ibm.com> 7.0.31-1
        bogus date in %changelog: Thu Nov 25 2016 Nitish K Mishra <nitismis@in.ibm.com> 7.0.13-1
        bogus date in %changelog: Thu Nov 26 2008 Michael Perzl <michael@perzl.org> - 5.2.8-1
        Bad exit status from /var/tmp/rpm-tmp.LJqMeb (%build)

     

    ##################

    ##################

    The following is a cat of

    php_ini.c.rej               <

    ##################### start of cat command ########################################
    ***************
    *** 612,618 ****
            /* If still no ini file found, search for php.ini file in search path */
            if (!fh.handle.fp) {
    -               fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &opened_path);
                    if (fh.handle.fp) {
                            fh.filename = ZSTR_VAL(opened_path);
                    }
    --- 612,618 ----
            /* If still no ini file found, search for php.ini file in search path */
            if (!fh.handle.fp) {
    +               fh.handle.fp = php_fopen_with_path("php64.ini", "r", php_ini_search_path, &opened_path);
                    if (fh.handle.fp) {
                            fh.filename = ZSTR_VAL(opened_path);
                    }

    ########################## End of cat command ##############################

    Thanks in advance.

     


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 7.  Re: Request to add mariadb support for php package

    Posted Tue March 17, 2020 03:36 AM

    Originally posted by: AyappanP


    PHP having mysql support is now available in AIX Toolbox. 

    https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/php/

    The rpm name is "php-mysqlnd".  Use yum to install it. 


    #AIX-Open-Source-Software
    #AIXOpenSource