Use the Phpinfo () function to output PHP information and locate the configuration File (php.ini)
Apachectl's design intent is to help administrators control the functionality of the Apache httpd daemon.
Centos linux PHP extension installation steps
1 first into the PHP source package
Cd/opt/php-5.1.2/ext/zlib
2 Generate configure files under the Zlib folder (PHP installation directory/opt/php/)
/opt/php/bin/phpize
3 Configuration Compilation
./configure--with-php-config=/opt/php/bin/php-config--with-zlib
Make && make install
4 Generate a zlib.so file under/opt/php/lib/php/extensions
5 Determine extension_dir=/opt/php/lib/php/extensions and extension=zlib.so in the php.ini file
6 Recompile PHP
Install the GD Library extension.
My PHP is unzipped in/home/web/php-5.4/
Can go directly to this directory
cd/home/web/php-5.4/
And then reconfigure PHP, configuration is to retain the original configuration based on the new GD library,
The original configuration may be installed by many people forget, it's okay, this can be seen in the Configure Command of Phpinfo ()
'./configure '--prefix=/home/web/php-5.4/'--with-apxs2=/home/web/apache/bin/apxs '--with-mysql=/usr '-- with-config-file-path=/home/web/php-5.4/'--enable-mbstring '
Change to Linux command
./configure--prefix=/home/web/php-5.4/--with-apxs2=/home/web/apache/bin/apxs--with-mysql=/usr-- with-config-file-path=/home/web/php-5.4/--enable-mbstring--WITH-GD--with-curl
If configure executes successfully, you can see thank for using PHP.
Perform
Make
Make install
Reboot Apache complete.
Centos linux PHP extension installation steps