Troubleshoot problems with PHP installation

Source: Internet
Author: User
Tags sapi
Troubleshoot problems with PHP 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

Need PHP support images need GD library

Since the operating system comes with the GD PNG JPEG library and so on, it is impossible to specify dir directly in the form of--with-jpeg.

The following error occurred while 2.make install:

Installing PHP SAPI Module:apache2handler
/usr/share/apache2/build/instdso.sh sh_libtool= '/usr/share/apr-1.0/build/libtool ' libphp5.la/usr/lib/apache2/ Modules
/usr/share/apr-1.0/build/libtool--mode=install CP libphp5.la/usr/lib/apache2/modules/
LIBTOOL:INSTALL:CP. libs/libphp5.so/usr/lib/apache2/modules/libphp5.so
LIBTOOL:INSTALL:CP. libs/libphp5.lai/usr/lib/apache2/modules/libphp5.la
Libtool:install:warning:remember to run ' Libtool--finish/home/hcc/php-5.2.13/libs '
chmod 644/usr/lib/apache2/modules/libphp5.so
Apxs:Error:Activation failed for custom/etc/apache2/httpd.conf file:
apxs:Error:At least one ' LoadModule ' directive already have to exist.
Make: * * * [INSTALL-SAPI] Error 1

Actually, httpd.conf already exists. Do not know why the above error, using the following methods, first backup httpd.conf

and re-build a httpd.conf.

Content

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

This will install successfully

3. After the PHP installation, found that PHP does not support JPEG, but in the above configuration has been added--with-jpeg, and libjpeg rpm is also installed, but it is always unable to support, had to reinstall the JPEG library

Download JPEGV6

Ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/jpeg-6b.tar.gz

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

And then install the 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 the installation to support JPEG
  • 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: info-contact@alibabacloud.com 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.