Aqui está um exemplo onde você verá os passos para esse processo (parece que você está perdendo a diretiva apxs2 e o
#!/bin/sh
# ####################################################
# PHP INSTALLATION SHELL for compiled version
# By Hornetbzz - 17/09/2010
# localhost stands for the machine to be installed
# remote host stands for the machine to be duplicated
# chmod 700 and run as root
# ####################################################
# ########################
# USER CONTROL
# ########################
[[ $(whoami) != "root" ]] && echo "pls run as root" && exit
# ########################
# SOURCE DIR
# ########################
SRC=/usr/local/src
# ########################
# latest php tarball
# check the most recent mtime tarball in the source directory (already downloaded)
# ########################
LOCAL_SRC_INSTALLED=$(ls -t *tar.gz $SRC | head -1)
echo "latest php tarball: $LOCAL_SRC_INSTALLED"
[[ ! -z $LOCAL_SRC_INSTALLED ]] && LOCAL_SRC_INSTALLED=$SRC/$LOCAL_SRC_INSTALLED
echo "latest php tarball (full path): $LOCAL_SRC_INSTALLED"
# get source files from mirror if no tarball already existing in the src directory
if [ -z $LOCAL_SRC_INSTALLED ];then
echo "No php tarball found => it will be downloaded from mirror" && exit
MIRROR="fr.php.net"
VERSION="5.3.3"
cd $SRC
wget http://$MIRROR/get/php-$VERSION.tar.gz/from/this/mirror
# tarball checksum : not done
mv mirror "php-$VERSION.tar.gz"
# get the last accessed tarball file
LOCAL_SRC_INSTALLED=$SRC/"php-$VERSION.tar.gz"
fi
# name with full path
echo "checkpoint: $LOCAL_SRC_INSTALLED"
# ########################
# PROCEED to installation
# ########################
if [ -f $LOCAL_SRC_INSTALLED ];then
echo "Local PHP sources : $LOCAL_SRC_INSTALLED"
# change directory - keep this even if already done -
cd $SRC
# untar
tar xzf $LOCAL_SRC_INSTALLED
# get the new dir name created on the localhost after untar
echo "basename: " && echo $(basename $LOCAL_SRC_INSTALLED)
NEW_DIR_NAME=$(basename $LOCAL_SRC_INSTALLED | sed -e "s/\.tar\.gz$//")
echo "Info: New src directory created: $NEW_DIR_NAME"
# change directory
cd /usr/local/src/$NEW_DIR_NAME
[[ -f "config.nice ]] && cp config.nice config.nice.original
# NOTA: copying this shell, you may have to escape each included quote by a backslash, like this \"
echo -e "
# build: import remote host config.nice into the localhost installation shell
# Created by configure
'./configure' \
'--prefix=/usr/local/php' \
'--with-apxs2=/usr/bin/apxs2' \
'--enable-embed' \
'--with-config-file-path=/usr/local/php/php.ini' \
'--with-config-file-scan-dir=/usr/local' \
'--with-gd=shared' \ # NOTA: remove "=shared" if you install a bundled lib as explained in my wiki page
all other options there
'--enable-mbstring' \
"$@"
" > config.nice
make clean
./config.nice
make
make install
echo -e "LoadModule php5_module /usr/local/php/lib/libphp5.so \n
AddType application/x-httpd-php .php \n
PHPIniDir "/usr/local/php \n" >> /etc/apache2/httpd.conf
/etc.init.d/apache2 stop
/etc.init.d/apache2 start
/etc.init.d/apache2 reload
else
echo "PHP source : local tarball not found in $SRC"
fi