4

04 LTS 64 bit.

What I would really love to do is sudo apt-get install libapache2-mod-php5 but compile PHP with --enable-maintainer-zts so I could later install pthreads with pecl install pthreads. Sadly I understand that it is not possible. I know that the easiest way is to recompile PHP together with apache support and zts. However I really like the way the standard Ubuntu PHP package is configured and I am used to the path`s for CLI php.ini config, Apache php.ini config and other paths for modules and files that this Ubuntu package defines. So i just want to change the package source a little bit and install it.

# Get the stuff necessary to build the package
sudo apt-get build-dep php5-common

# Get the package source
sudo apt-get source php5-common

At this point I am getting sources not for the php5-common package but the whole php5 package. If I would sudo make && make install at this point, would it mean that I am installing a lot of unnecessary stuff?

# Add configuration options
./configure --enable-maintainer-zts

Does this mean that I am appending a configuration option? Or am I generating a whole new config?

Alternative at this point Is there a way of getting the config options that this package defines, so that I can grab a php source from php.net and compile it with

$ ./configure  --prefix=package_prefix \ // Option 1 from package
--enable-embed \ // Option 2 from package
--with-regex=php \ // Option 3 from package

Continuing the main idea ...

Solution 1

# Compile (Not compiling)
sudo make && make install

Will I be building PHP with EVERYTHING at this point? If I compile like this, I will not be able to remove the mess I made using sudo apt-get purge php5?

Solution 2

# ReCompile the package
dpkg-buildpackage -rfakeroot -uc -b

This does not compile also. Please correct my steps, so I can install everything correctly.

ankit7540
  • 4,185
Drug
  • 41
  • 1
  • 2

1 Answers1

1

You can get the options easily like this (you could look in the source package but this is way less work):

$ sudo apt-get install php5-dev
$ php-config --configure-options

--prefix=/usr --with-apxs2=/usr/bin/apxs2 --with-config-file-path=/etc/php5/apache2 
--with-config-file-scan-dir=/etc/php5/apache2/conf.d --build=x86_64-linux-gnu 
--host=x86_64-linux-gnu --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man 
--disable-debug --with-regex=php --disable-rpath --disable-static --with-pic 
--with-layout=GNU --with-pear=/usr/share/php --enable-calendar --enable-sysvsem 
--enable-sysvshm --enable-sysvmsg --enable-bcmath --with-bz2 --enable-ctype 
--with-db4 --without-gdbm --with-iconv --enable-exif --enable-ftp --with-gettext 
--enable-mbstring --with-pcre-regex=/usr --enable-shmop --enable-sockets 
--enable-wddx --with-libxml-dir=/usr --with-zlib --with-kerberos=/usr 
--with-openssl=/usr --enable-soap --enable-zip --with-mhash=yes --with-system-tzdata 
--with-mysql-sock=/var/run/mysqld/mysqld.sock --enable-dtrace --without-mm 
--with-curl=shared,/usr --with-enchant=shared,/usr --with-zlib-dir=/usr 
--with-gd=shared,/usr --enable-gd-native-ttf --with-gmp=shared,/usr 
--with-jpeg-dir=shared,/usr --with-xpm-dir=shared,/usr/X11R6 
--with-png-dir=shared,/usr --with-freetype-dir=shared,/usr 
--with-vpx-dir=shared,/usr --enable-intl=shared --without-t1lib 
--with-ldap=shared,/usr --with-ldap-sasl=/usr --with-mysql=shared,/usr 
--with-mysqli=shared,/usr/bin/mysql_config --with-pspell=shared,/usr 
--with-unixODBC=shared,/usr --with-recode=shared,/usr --with-xsl=shared,/usr 
--with-snmp=shared,/usr --with-sqlite3=shared,/usr --with-mssql=shared,/usr 
--with-tidy=shared,/usr --with-xmlrpc=shared --with-pgsql=shared,/usr

See man php-config for even more options.

Fabby
  • 34,259
Wrikken
  • 111