robue-a7119895
robue-a7119895

Reputation: 826

PHP installs httpd instead of FPM from build

I am on a CentOS VPS, and whenever I install php from build, it installs httpd server instead of php-fpm. In short, I can start php using service start php-fpm as I would normally do if I was to install php from webtatic or remi repos. Here is how I am building php after installing the *-devel components.

$ wget http://ch1.php.net/get/php-5.6.0.tar.bz2/from/this/mirror
$ tar jxf php-5.6.0.tar.bz2
$ cd php-5.6.0/
$ ./configure --with-mysql --enable-mbstring --enable-exif --with-pdo-mysql=mysqlnd --enable-cli --with-gd  --enable-session --enable-dom --enable-phpdbg --enable-fpm --enable-ctype --with-vpx-dir --with-jpeg-dir --with-png-dir --with-xpm-dir --with-freetype-dir

Upvotes: 1

Views: 244

Answers (3)

stanleyxu2005
stanleyxu2005

Reputation: 8241

I'd a successful installation with the following commands:

wget http://ch1.php.net/get/php-5.6.0.tar.bz2/from/this/mirror
tar jxf php-5.6.0.tar.bz2
cd php-5.6.0/
./configure --prefix=/usr/local/php  --enable-fpm --with-mcrypt \
--enable-mbstring --disable-pdo --with-curl --disable-debug  --disable-rpath \
--enable-inline-optimization --with-bz2  --with-zlib --enable-sockets \
--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \
--with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli \
--with-gd --with-jpeg-dir

make all install

If any library is missing, please consider run the following commands on demand:

yum -y install gcc automake autoconf libtool make
yum -y install libmcrypt-devel mhash-devel libxslt-devel \
libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel \
zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel \
ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel \
krb5 krb5-devel libidn libidn-devel openssl openssl-devel

I'm not sure, if removing --enable-cli really helps, but you can try.

And by the way, for production environment, I'd recommend you using nginx instead of httpd, which has very impressive performance. The configuration migration to nginx is also very easy, if you do not have a lot of .htaccess files.

Upvotes: 1

Shushant
Shushant

Reputation: 1635

Note that you have to change --enable-cli with --enable-fpm which is optional anyway and proceed by make

$ wget http://ch1.php.net/get/php-5.6.0.tar.bz2/from/this/mirror
$ tar jxf php-5.6.0.tar.bz2
$ cd php-5.6.0/
$ ./configure --with-mysql --enable-mbstring --enable-exif --with-pdo-mysql=mysqlnd --enable-fpm --with-gd  --enable-session --enable-dom --enable-phpdbg --enable-fpm --enable-ctype --with-vpx-dir --with-jpeg-dir --with-png-dir --with-xpm-dir --with-freetype-dir
$ make 
$ sudo make install

Run a test

/usr/local/bin/php -v
# Outputs: 
# PHP 5.x.x (cli) (built: xxx)
# Copyright (c) 1997-20124 The PHP Group
# Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologiesnginx version: nginx/1.2.1

Upvotes: 1

Stanisalv Rassvetalov
Stanisalv Rassvetalov

Reputation: 21

try to use this configure-line

./configure --disable-all --with-mysql --enable-mbstring --enable-exif --with-pdo-mysql=mysqlnd --enable-cli --with-gd  --enable-session --enable-dom --enable-phpdbg --enable-fpm --enable-ctype --with-vpx-dir --with-jpeg-dir --with-png-dir --with-xpm-dir --with-freetype-dir

and also need to see output error.

Upvotes: 2

Related Questions