WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Compiling php7.2.10  (Read 1623 times)

Offline PingPing

  • Jr. Member
  • **
  • Posts: 99
Compiling php7.2.10
« on: October 09, 2018, 12:15:49 PM »
Hi.

I would like to build php7.2.10.
I am not familiar with php and would appreciate some tips on configure options.
Can anyone please suggest the options I should configure it with?

THX_IN_ADV

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Compiling php7.2.10
« Reply #1 on: October 09, 2018, 09:04:52 PM »
This is what I use for the extension I maintain on 32 and 64-bit TC. You will probably not need all these options.

Code: [Select]
./configure
--prefix=/usr/local
--sysconfdir=/usr/local/etc
--localstatedir=/var
--datadir=/usr/local/share
--mandir=/usr/local/share/man
--with-config-file-path=/usr/local/etc/php7/
--with-config-file-scan-dir=/usr/local/etc/php7/extensions/
--enable-shared
--with-apxs2=/usr/local/bin/apxs
--enable-dmalloc=shared
--enable-libgcc
--with-system-ciphers
--enable-pdo=shared
--disable-embed
--disable-inline-optimization
--disable-mysqlnd
--disable-rpath
--disable-static
--enable-bcmath=shared
--with-bz2=shared,/usr/local
--enable-calendar=shared
--enable-ctype=shared
--with-curl=shared,/usr/local
--enable-dba=shared
--enable-dom=shared
--with-enchant=shared,/usr/local
--enable-exif=shared
--enable-fileinfo=shared
--enable-filter
--with-freetype-dir=/usr/local
--enable-ftp=shared
--with-gd=shared,/usr/local
--enable-gd-jis-conv
--with-gdbm=shared,/usr/local
--with-gettext=shared,/usr/local
--with-gmp=shared,/usr/local
--enable-hash=shared
--with-iconv=shared
--with-icu-dir=/usr/local
--enable-intl=shared
--with-jpeg-dir=/usr/local
--enable-json=shared
--with-ldap-sasl=/usr/local
--with-ldap=shared,/usr/local
--with-libxml-dir=/usr/local
--enable-libxml
--enable-mbstring=shared
--with-mhash=shared,/usr/local
--with-mysqli=shared,/usr/local/mysql/bin/mysql_config
--with-pdo-mysql=shared,/usr/local/mysql
--enable-opcache=shared
--disable-opcache-file
--with-openssl-dir=/usr/local
--with-openssl=shared,/usr/local
--enable-pcntl=shared
--with-pcre-dir=/usr/local
--with-pcre-regex=/usr/local
--with-unixODBC=shared,/usr/local
--with-pdo-odbc=shared,unixODBC
--with-png-dir=/usr/local
--enable-posix=shared
--with-pspell=shared,/usr/local
--with-readline=shared,/usr/local
--with-recode=shared,/usr/local
--enable-session=shared
--enable-shmop=shared
--enable-simplexml=shared
--with-snmp=shared,/usr/local
--enable-soap=shared
--enable-sockets=shared
--with-sodium=shared,/usr/local
--with-sqlite3=shared,/usr/local
--with-pdo-sqlite=shared,/usr/local
--enable-sysvmsg=shared
--enable-sysvsem=shared
--enable-sysvshm=shared
--with-tidy=shared,/usr/local
--enable-tokenizer=shared
--with-tsrm-pthreads
--enable-wddx=shared
--with-webp-dir=/usr/local
--enable-xml=shared
--enable-xmlreader=shared
--with-xmlrpc=shared
--enable-xmlwriter=shared
--with-xpm-dir=no
--with-xsl=shared,/usr/local
--enable-zend-signals
--enable-zip=shared
--with-libzip=/usr/local
--with-zlib=shared,/usr
--with-zlib-dir=/usr
--enable-cgi
--enable-cli
--enable-fpm
--with-litespeed
--enable-phpdbg
--enable-phpdbg-webhelper=shared
--enable-phar=shared             
--with-pear=shared,/usr/local/lib/php/pear
--with-pgsql=shared,/usr/local/pgsql$PGVER
--with-pdo-pgsql=shared,/usr/local/pgsql$PGVER
--with-oci8=shared,instantclient,/usr/local/oracle/lib
--with-pdo-oci=shared,/usr/local/oracle

Make install will complain and die if a copy of the current httpd.conf file isn't in the install tree in the right place.

Pear requires xml to install so make sure the XML module gets loaded:

Code: [Select]
sed -i '/^PEAR_INSTALL_FLAGS/s#$# -d extension_dir=$(top_builddir)/modules/ -d extension=xml.so#' Makefile
Then you can make install.

Good luck.

Offline PingPing

  • Jr. Member
  • **
  • Posts: 99
Re: Compiling php7.2.10
« Reply #2 on: October 11, 2018, 08:20:39 AM »
Thanks Andy.
I did try a basic ./configure --prefix=/usr/local and the compiler errored after 1hr (on my Pi Zero).  I guess it was because of the http.conf issue you mentioned.
btw, on nginx, I've compiled LibGD and submitted it to (Bela) to look at but I understand he's quite busy so it'll show up in the repos when he has time, I guess.
I've also compiled nginx (with LibGD support) and will submit it to Bela when I've checked I can get PHP and WordPress working with it.
Cheers