PHP recompile php extension, but not show in the Configure Command

Support for webhosts that use CentOS
Post Reply
shiroamada
Posts: 3
Joined: 2012/04/03 11:54:13

PHP recompile php extension, but not show in the Configure Command

Post by shiroamada » 2012/04/05 01:39:01

I am newbie in CentOS.

OS: CentOS 5.8 86_64


I would like manually install PHP 5.2.17. I manage to install httpd and mysql.

But when I want to PHP 5.2.17, I could not found a proper guide. These the step I had done with a fresh installation of CentOS 5.8 x86_64 (server & server GUI)

[code]yum install httpd httpd-devel[/code]

[code]/etc/init.d/httpd start[/code] OK

[code]/etc/init.d/httpd stop[/code] OK

[code]yum install mysql mysql-server mysql-devel[/code]

[code]yum remove php[/code]

[code]yum groupinstall "Development Tools"[/code]

[code]yum install libxml2-devel[/code]

[code]wget http://www.php.net/release/php5.2.17.zip[/code] to get php5.2.17 (client requirement must use this version)

[code]cd php5.2.17[/code]

[code]./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/usr/local --with-zlib-dir --with-libdir=lib64[/code]

[code]make[/code]

[code]make test[/code]

[code]make install[/code]

[code]/etc/init.d/httpd start[/code] OK

I run in in phpinfo().

It shows:
[code]Configure Command './configure' '--with-apxs2' '--with-mysql' '--with-zlib-dir' '--with-libdir=lib64'[/code]

However, later on I would like add more PHP extension. What I did is

[code]/etc/init.d/httpd stop[/code] OK

[quote]
yum install pcre-devel.x86_64 bzip2-devel.x86_64 curl-devel.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 libXpm-devel.x86_64 freetype-devel.x86_64 libc-client-devel.x86_64 libmcrypt-devel.x86_64 aspell-devel.x86_64 libtidy-devel.x86_64 libxslt-devel.x86_64
[/quote]

[quote]
./configure --with-apxs2 --with-mysql --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-magic-quotes --enable-mbstring --enable-pdo=shared --enable-soap --enable-sockets --enable-wddx --enable-zend-multibyte --enable-zip --prefix=/usr --with-bz2 --with-curl=/opt/curlssl/ --with-curlwrappers --with-freetype-dir=/usr --with-gd --with-gettext --with-imap=/opt/php_with_imap_client/ --with-imap-ssl=/usr --with-jpeg-dir=/usr --with-kerberos --with-libdir=lib64 --with-libexpat-dir=/usr --with-libxml-dir=/opt/xml2 --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mysql=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-openssl=/usr --with-openssl-dir=/usr --with-pcre-regex=/usr/include --with-pcre-regex=/usr --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pic --with-png-dir=/usr --with-pspell --with-sqlite=shared --with-tidy=shared,/usr --with-ttf --with-xmlrpc --with-xpm-dir=/usr --with-xsl=/opt/xslt/ --with-zlib --with-zlib-dir=/usr
[/quote][Moderator edit: Changed [i]code[/i] to [i]quote[/i] tags to wrap [b]long[/b] lines.]

[code]make clean[/code]

[code]make[/code]

[code]make test[/code]

[code]make install[/code]

Everything work very well.

[code]/etc/init.d/httpd start[/code] OK

However, all the latest extension that I install did not show in the phpinfo().

It still show

[code]Configure Command './configure' '--with-apxs2' '--with-mysql' '--with-zlib-dir' '--with-libdir=lib64'[/code]

What is the thing I missing?

I do a lot of research on internet, mostly they are using yum install php to resolve it, but I in the centos repository, I can't get php 5.2.17
This is the first time I am in CentOS and Linux environment, I hope your guys can help in this area. What is the solution on this.

Thanks!

shiroamada
Posts: 3
Joined: 2012/04/03 11:54:13

Re: PHP recompile php extension, but not show in the Configure Command

Post by shiroamada » 2012/04/05 08:20:46

OK. I solved it out with my own.

I deleted the php-5.2.17 folder, then I extract again the php5.2.17.tar.gz file again.

I think my previous php-5.2.17 still cache the old build file (maybe? I am not familiar).

After the new extract folder, I try to recompile it again. It works charm!

Thanks all!

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

PHP recompile php extension, but not show in the Configure C

Post by pschaff » 2012/04/05 20:17:00

It may have worked but that does not mean it is the correct approach. Please read about [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14408&forum=47]Installing Software[/url] and [url=http://wiki.centos.org/AdditionalResources/Repositories]Repositories[/url], and note the warnings and advice about installing and configuring the [url=http://wiki.centos.org/PackageManagement/Yum/Priorities]yum priorities plugin[/url]. Non-core repos should have a higher numeric value, which is a lower priority. Lower is "better" as in golf scores.

[url=http://wiki.centos.org/PackageManagement/SourceInstalls]Source Installs[/url] are [b]highly[/b] discouraged. Package based systems should use packages if at all possible.

A number of 3rd party [url=http://wiki.centos.org/AdditionalResources/Repositories]Repositories[/url] offer later PHP packages. I don't have access to a CentOS-5 system at the moment to check version availability, but I believe IUS is a good source.

jpchang72
Posts: 1
Joined: 2012/06/01 08:24:41

Re: PHP recompile php extension, but not show in the Configure Command

Post by jpchang72 » 2012/06/01 08:35:39

Source Installs are highly discouraged. Package based systems should use packages if at all possible.

>> I cannot agree whith this point. I have been using Linux for 20 years.. and I am more enjoying to setup system with source compile. It is more likely controlled environemnt. so if you know what you are doing, It cannot go wrong. But downtime of this is that takes a lots of effort, some time there are not enough resource to resolve certain issue. Once you are understanding how it works on system, it is a lot easier to upgrade to newer source. I am more recommand to do this if you really want to understand how it works. Please guide me what would be benefit of using pkg based install vs source installation, With source complie, you can even create your own pkg and using it to upgrade your system(Isn't it What you are using? How pkg has been created at first place). Only downtime is lack of resource and a lot of effort to understand it. I would spend more time to understand how software works rather spend a lot of time with googling and follow resources that is already out of date or does not work with newer os.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: [OT] PHP recompile php extension, but not show in the Configure Command

Post by pschaff » 2012/06/01 14:25:11

Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

You are certainly entitled to your opinion, but I believe you will find the majority of senior contributors here will not endorse source installs, except as a last resort. Rolling your own packages is a different matter, and is far superior to installing from a tarball and bypassing the packaging system, but may still be problematic if replacement of critical core packages is necessary to satisfy dependencies. If you would like to explore the issues further please start a topic in
[url=https://www.centos.org/modules/newbb/viewforum.php?forum=14]Social[/url]. The debate is off topic here.

Post Reply

Return to “CentOS 5 - Webhosting Support”