BreadCrumbs: PHP Install
PHP Install
From Luke Jackson
(Difference between revisions)
| Revision as of 17:37, 16 February 2012 (edit) Ljackson (Talk | contribs) (→Premature end of script headers: php) ← Previous diff |
Revision as of 15:49, 20 February 2012 (edit) Ljackson (Talk | contribs) (→If you do not have mysql-client, mysql-devel, mysql-server, mysql-shared-compat installed) Next diff → |
||
| Line 98: | Line 98: | ||
| configure: error: Cannot find MySQL header files under /usr/local. | configure: error: Cannot find MySQL header files under /usr/local. | ||
| + | |||
| + | === Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. === | ||
| + | |||
| + | This problem is caused by missing couple variables at the shell level: PHP_AUTOCONF, PHP_AUTOHEADER. It is very easy to solve this problem: | ||
| + | |||
| + | '''Note''': Autoconf 2.13 may be required to build older versions of PHP | ||
| + | |||
| + | export PHP_AUTOCONF=/usr/bin/autoconf-2.13 | ||
| + | export PHP_AUTOHEADER=/usr/bin/autoheader-2.13 | ||
| === Premature end of script headers: php === | === Premature end of script headers: php === | ||
Revision as of 15:49, 20 February 2012
Install Script
VERSION="5.2.2"
echo "--> Installing PHP"
echo $VERSION
rm -rf php-$VERSION
tar xvzf php-$VERSION.tar.gz
cd php-$VERSION
./configure \
--prefix=/usr/local/php5 \
--build=i387-redhat-linux \
--host=i386-redhat-linux \
--target=i386-redhat-linux-gnu \
--with-config-file-path=/www \
--enable-force-cgi-redirect \
--disable-safe-mode \
--enable-versioning \
--with-mysql=/usr/local \
--with-dbase \
--enable-ftp \
--enable-sysvsem \
--enable-sysvshm \
--enable-shmop \
--with-gd \
--enable-gd-native-ttf \
--with-ttf \
--with-freetype-dir \
--with-jpeg-dir=/usr/local \
--with-zlib \
--enable-libgcc \
--enable-mbstring \
--enable-xslt \
--with-xslt-sablot \
--with-gettext \
--with-zip \
--with-bz2 \
--with-iconv \
--enable-exif \
--enable-bcmath \
--with-openssl \
--enable-sockets \
--with-xmlrpc \
make
make install
mkdir /www/cgi-bin/php5
install /usr/local/php5/bin/php /www/cgi-bin/php5
Satisfy Dependencies
yum install gcc gcc-c++ flex libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel
Common Errors
If you do not have gcc installed
configure: error: no acceptable cc found in $PATH
If you do not have gcc-c++ installed
configure: error: installation or configuration problem: C++ compiler cannot create executables.
If you do not have flex installed
configure: error: cannot find output from lex; giving up
If you do not have libxml2 libxml2-devel installed
configure: error: xml2-config not found. Please check your libxml2 installation.
If you do not have bzip2 bzip2-devel installed
configure: error: Please reinstall the BZip2 distribution
If you do not have openssl, openssl-devel installed
configure: error: Cannot find OpenSSL's <evp.h>
If you do not have libjpeg, libjpeg-devel installed
configure: error: libjpeg.(a|so) not found.
If you do not have libpng, libpng-devel installed
configure: error: libpng.(a|so) not found.
If you do not have freetype, freetype-devel installed
configure: error: freetype2 not found!
If you do not have mysql-client, mysql-devel, mysql-server, mysql-shared-compat installed
configure: error: Cannot find MySQL header files under /usr/local.
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
This problem is caused by missing couple variables at the shell level: PHP_AUTOCONF, PHP_AUTOHEADER. It is very easy to solve this problem:
Note: Autoconf 2.13 may be required to build older versions of PHP
export PHP_AUTOCONF=/usr/bin/autoconf-2.13 export PHP_AUTOHEADER=/usr/bin/autoheader-2.13
Premature end of script headers: php
- Revert to php.ini-recommended
- Ensure files and directories are owned by apache and set to at least chmod 754
- Recompile PHP if problem persists try older revision.
- Ensure you are installing the php-cgi executable and not the bash executable
install /usr/local/php5/php-cgi /www/cgi-bin/php/php5-cgi