Php installation problems

Source: Internet
Author: User
Tags sapi
Php installation: 1. /configure -- prefix =/usr/local/php -- with-apxs2 =/home/apache/bin/apxs -- with-zlib-dir -- with-libxml-dir =/usr/local php troubleshooting during installation
Php installation:

1. /configure -- prefix =/usr/local/php -- with-apxs2 =/home/apache/bin/apxs -- with-zlib-dir -- with-libxml-dir =/usr/local/ libxml2/-- with-gd -- with-freetype -- with-jpeg -- with-png -- enable-mbstring -- with-mysql =/usr/local/mysql/-- with-mysqli =/ usr/local/mysql/bin/mysql_config -- enable-gd-native-ttf -- with-gettext =/usr/local/gettext/-- enable-magic-quotes -- enable-sockets

Gd Library is required for images supported by php

Because the operating system comes with the gd png jpeg library, you cannot specify the dir to use the format -- with-jpeg.

2. the following error occurs during make install:

Installing php sapi module: apache2handler
/Usr/share/apache2/build/instdso. sh SH_LIBTOOL = '/usr/share/apr-1.0/build/libtool '
/Usr/share/apr-1.0/build/libtool -- mode = install cp
Libtool: install: cp. libs/
Libtool: install: cp. libs/libphp5.lai/usr/lib/apache2/modules/
Libtool: install: warning: remember to run 'libtool -- finish/home/SCC/php-5.2.13/Libs'
Chmod 644/usr/lib/apache2/modules/
Apxs: Error: Activation failed for custom/etc/apache2/httpd. conf file ..
Apxs: Error: At least one 'loadmodule' directive already has to exist ..
Make: *** [install-sapi] Error 1

In fact, httpd. conf already exists. I don't know why the above error occurs. I used the following method to back up httpd. conf first.

Then create another httpd. conf


# LoadModule directive to aid module installations
# LoadModule dummy_module/usr/lib/apache2/modules/

In this way, the installation is successful.

3. after php is installed, it is found that php does not support jpeg, but -- with-jpeg has been added in the above configuration process, and libjpeg rpm is also installed, but it is always not supported, so you have to reinstall the jpeg Library

Download ikev6


Compile and install:./configure -- prefix =/usr/local/jpeg -- enable-shared

Then install php

/Configure -- prefix =/usr/local/php -- with-apxs2 =/home/apache/bin/apxs -- with-zlib-dir -- with-libxml-dir =/usr/local/ libxml2/-- with-gd -- with-freetype -- with-jpeg-dir =/usr/local/jpeg -- with-png -- enable-mbstring -- with-mysql =/usr/local /mysql/-- with-mysqli =/usr/local/mysql/bin/mysql_config -- enable-gd-native-ttf -- with-gettext =/usr/local/gettext/-- enable -magic-quotes -- enable-sockets

Recompile and install to support jpeg
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.