내 문제는 최신 버전이 아닌 PHP 5.3에서 작동하는 스크립트가 온라인에 있다는 것입니다. 부분 변경 사항을 업로드하는 대신 로컬로 웹 사이트를 개발하고 싶습니다. 많은 책을 읽은 후, 읽을 때 다음 스크립트를 작성했습니다. 또한이 게시물의 맨 아래에 링크 된 비디오를 만들었습니다.
#!/bin/bash
mkdir /opt/phpfcgi-5.3.24
mkdir /usr/local/src/php5-build
cd /usr/local/src/php5-build
wget http://de.php.net/get/php-5.3.24.tar.bz2/from/this/mirror -O php-5.3.24.tar.bz2
tar jxf php-5.3.24.tar.bz2
cd php-5.3.24/
apt-get install build-essential
apt-get build-dep php5
apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev
./configure \
--prefix=/opt/phpfcgi-5.3.24 \
--with-pdo-pgsql \
--with-zlib-dir \
--with-freetype-dir \
--enable-mbstring \
--with-libxml-dir=/usr \
--enable-soap \
--enable-calendar \
--with-curl \
--with-mcrypt \
--with-zlib \
--with-gd \
--with-pgsql \
--disable-rpath \
--enable-inline-optimization \
--with-bz2 \
--with-zlib \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-pcntl \
--enable-mbregex \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-mysql \
--with-pdo-mysql \
--with-mysqli \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--enable-gd-native-ttf \
--with-openssl \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
--with-libdir=/lib/x86_64-linux-gnu \
--enable-ftp \
--with-kerberos \
--with-gettext \
--enable-cgi
make
make install
cp /usr/local/src/php5-build/php-5.3.24/php.ini-production /opt/phpfcgi-5.3.24/lib/php.ini
apt-get -y install php-pear
cd /opt/phpfcgi-5.3.24/etc
pecl -C ./pear.conf update-channels
pecl -C ./pear.conf install apc
pecl -C ./pear.conf install memcache
pecl -C ./pear.conf install memcached
cd /tmp
wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
tar xfvz ioncube_loaders_lin_x86.tar.gz
cp ioncube/ioncube_loader_lin_5.3.so /opt/phpfcgi-5.3.24/lib/php/extensions/no-debug-non-zts-20090626/ioncube.so
echo "[...]" >> /opt/phpfcgi-5.3.24/lib/php.ini
echo "extension=apc.so" >> /opt/phpfcgi-5.3.24/lib/php.ini
echo "apc.enabled=1" >> /opt/phpfcgi-5.3.24/lib/php.ini
echo "apc.shm_size=128M" >> /opt/phpfcgi-5.3.24/lib/php.ini
echo "apc.ttl=0" >> /opt/phpfcgi-5.3.24/lib/php.ini
echo "apc.user_ttl=600" >> /opt/phpfcgi-5.3.24/lib/php.ini
echo "apc.gc_ttl=600" >> /opt/phpfcgi-5.3.24/lib/php.ini
echo "apc.enable_cli=1" >> /opt/phpfcgi-5.3.24/lib/php.ini
echo "apc.mmap_file_mask=/tmp/apc.XXXXXX" >> /opt/phpfcgi-5.3.24/lib/php.ini
echo "extension=memcache.so" >> /opt/phpfcgi-5.3.24/lib/php.ini
echo "extension=memcached.so" >> /opt/phpfcgi-5.3.24/lib/php.ini
sed -i.bak "1i zend_extension \= \/opt\/phpfcgi-5.3.24\/lib\/php\/extensions\/no-debug-non-zts-20090626\/ioncube.so" /opt/phpfcgi-5.3.24/lib/php.ini
kate /opt/phpfcgi-5.3.24/lib/php.ini
mkdir /var/www/cgi-bin
echo "#!/bin/sh" > /var/www/cgi-bin/php5324.fcgi
echo "PHP_FCGI_CHILDREN=3" >> /var/www/cgi-bin/php5324.fcgi
echo "export PHP_FCGI_CHILDREN" >> /var/www/cgi-bin/php5324.fcgi
echo "PHP_FCGI_MAX_REQUESTS=5000" >> /var/www/cgi-bin/php5324.fcgi
echo "export PHP_FCGI_MAX_REQUESTS" >> /var/www/cgi-bin/php5324.fcgi
echo "# which php-cgi binary to execute" >> /var/www/cgi-bin/php5324.fcgi
echo "exec /opt/phpfcgi-5.3.24/bin/php-cgi" >> /var/www/cgi-bin/php5324.fcgi
chmod +x /var/www/cgi-bin/php5324.fcgi
echo "<VirtualHost *:80>" > /etc/apache2/sites-available/dev.conf
echo " ServerName dev.dev" >> /etc/apache2/sites-available/dev.conf
echo " DocumentRoot /var/www" >> /etc/apache2/sites-available/dev.conf
echo " <Directory \"/var/www\">" >> /etc/apache2/sites-available/dev.conf
echo " Options Indexes FollowSymLinks MultiViews" >> /etc/apache2/sites-available/dev.conf
echo " AllowOverride All" >> /etc/apache2/sites-available/dev.conf
echo " Order allow,deny" >> /etc/apache2/sites-available/dev.conf
echo " allow from all" >> /etc/apache2/sites-available/dev.conf
echo " AddHandler php-cgi .php" >> /etc/apache2/sites-available/dev.conf
echo " Action php-cgi /var/www/cgi-bin/php5324.fcgi" >> /etc/apache2/sites-available/dev.conf
echo " <FilesMatch \"\.php$\">" >> /etc/apache2/sites-available/dev.conf
echo " SetHandler php-cgi" >> /etc/apache2/sites-available/dev.conf
echo " </FilesMatch>" >> /etc/apache2/sites-available/dev.conf
echo " </Directory>" >> /etc/apache2/sites-available/dev.conf
echo "</VirtualHost>" >> /etc/apache2/sites-available/dev.conf
a2ensite dev
sed -i.bak "1i 127.0.0.1 dev.dev" /etc/hosts
service apache2 reload
http://larrykeenan.com/php53.html
미리 감사드립니다. 래리 키넌
2
Ask Ubuntu에 오신 것을 환영합니다. 질문에 솔루션을 추가하지 마십시오. 자신의 질문에 대한 답변으로 답변을 게시하십시오 .
—
MadMike