sbmzhcn 发表于 2011-5-22 16:01:50

lnmp0.7在Ubuntu11.04下安装后502错误

内核: Linux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux
系统版本: Ubuntu 11.04
操作系统是32位的。log2M,无法上传。说下错误信息吧。错误信息:root@ubuntu:~/lnmp0.7-full/php-5.2.17# /root/lnmp restart
=========================================================================
Manager for LNMP V0.7,Written by Licess
=========================================================================
LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
This script is a tool to Manage status of lnmp
For more information please visit http://www.lnmp.org 1

Usage: /root/lnmp {start|stop|reload|restart|kill|status}
=========================================================================
Stoping LNMP...
Nginx program is stop
PHP-FPM program is not runing!
Shutting down MySQL
. *
MySQL program is stop
Starting LNMP...
Nginx start successfully!
/root/lnmp: 行 46: /usr/local/php/sbin/php-fpm: 没有那个文件或目录
PHP-FPM start successfully!
Starting MySQL
. *
MySQL start successfully!在这个论坛上找了好几天知道大概是php没有安装成功,按步骤重新安装,证明这些方法全是不可行,(PS:发现这论坛上面说的大部分是没用的)

我查看/root/lnmp-0.7-full/ubuntu.sh ,按照:echo "========================= php + php extensions install ==================="
cd $cur_dir
export PHP_AUTOCONF=/usr/local/autoconf-2.13/bin/autoconf
export PHP_AUTOHEADER=/usr/local/autoconf-2.13/bin/autoheader
tar zxvf php-5.2.17.tar.gz
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
cd php-5.2.17/
./buildconf --force
./configure
--prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir
--with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib
--with-libxml-dir=/usr --enable-xml --enable-discard-path
--enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop
--enable-sysvsem --enable-inline-optimization --with-curl
--with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm
--enable-force-cgi-redirect --enable-mbstring --with-mcrypt --enable-ftp
--with-gd --enable-gd-native-ttf --with-openssl --with-mhash
--enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap
--without-pear --with-gettext --with-mime-magic
make ZEND_EXTRA_LIBS='-liconv'
make install

mkdir -p /usr/local/php/etc
cp php.ini-dist /usr/local/php/etc/php.ini
strip /usr/local/php/bin/php-cgi
cd ../

ln -s /usr/local/php/bin/php /usr/bin/php
ln -s /usr/local/php/bin/phpize /usr/bin/phpize
ln -s /usr/local/php/sbin/php-fpm /usr/bin/php-fpm

cd $cur_dir
tar zxvf memcache-3.0.5.tgz
cd memcache-3.0.5/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
cd ../

tar zxvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
make && make install
cd ../

# php extensions
sed
-i 's#extension_dir = "./"#extension_dir =
"/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"\nextension
= "memcache.so"\nextension = "pdo_mysql.so"\n#'
/usr/local/php/etc/php.ini
sed -i 's#output_buffering = Off#output_buffering = On#' /usr/local/php/etc/php.ini
sed -i 's/post_max_size = 8M/post_max_size = 50M/g' /usr/local/php/etc/php.ini
sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /usr/local/php/etc/php.ini
sed -i 's/;date.timezone =/date.timezone = PRC/g' /usr/local/php/etc/php.ini
sed -i 's/short_open_tag = Off/short_open_tag = On/g' /usr/local/php/etc/php.ini
sed -i 's/; cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /usr/local/php/etc/php.ini
sed -i 's/max_execution_time = 30/max_execution_time = 300/g' /usr/local/php/etc/php.ini

if [ `getconf WORD_BIT` = '32' ] && [ `getconf LONG_BIT` = '64' ] ; then
      wget -c http://soft.vpser.net/web/zend/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
      tar zxvf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
      mkdir -p /usr/local/zend/
      cp ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so /usr/local/zend/
else
      wget -c http://soft.vpser.net/web/zend/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
      tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
      mkdir -p /usr/local/zend/
      cp ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so /usr/local/zend/
fi

cat >>/usr/local/php/etc/php.ini<<eof
;eaccelerator

;ionCube


zend_optimizer.optimization_level=1
zend_extension="/usr/local/zend/ZendOptimizer.so"
EOF

wget -c http://soft.vpser.net/lnmp/ext/init.d.php-fpm5.2
cp init.d.php-fpm5.2 /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
echo
"======================== php + php extensions install
=================="在./configure --prefix=/usr/local/php
--with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir
--with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib
--with-libxml-dir=/usr --enable-xml --enable-discard-path
--enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop
--enable-sysvsem --enable-inline-optimization --with-curl
--with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm
--enable-force-cgi-redirect --enable-mbstring --with-mcrypt --enable-ftp
--with-gd --enable-gd-native-ttf --with-openssl --with-mhash
--enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap
--without-pear --with-gettext --with-mime-magic最后出现:
configure: error: libjpeg.(a|so) not found.
再往下无法继续执行:root@ubuntu:~/lnmp0.7-full/php-5.2.17# make ZEND_EXTRA_LIBS='-liconv'
make: *** 没有指明目标并且找不到 makefile。 停止。最后,不仅仅期待你的回答,更期待正确的解决方案,另外,希望不要复制别人的或者说些不具体的话,我已经用google查了好多天了,所以不要浪费我的时间!!!

另:php -v 执行情况root@ubuntu:~/lnmp0.7-full/php-5.2.17# php -v
PHP Deprecated:Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0
PHP
Warning:PHP Startup: Unable to load dynamic library
'/usr/lib/php5/20090626+lfs/mysql.so' -
/usr/lib/php5/20090626+lfs/mysql.so: cannot open shared object file: No
such file or directory in Unknown on line 0
PHP Warning:PHP
Startup: Unable to load dynamic library
'/usr/lib/php5/20090626+lfs/mysqli.so' -
/usr/lib/php5/20090626+lfs/mysqli.so: cannot open shared object file: No
such file or directory in Unknown on line 0
PHP Warning:PHP
Startup: Unable to load dynamic library
'/usr/lib/php5/20090626+lfs/pdo_mysql.so' -
/usr/lib/php5/20090626+lfs/pdo_mysql.so: cannot open shared object file:
No such file or directory in Unknown on line 0
PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch (cli) (built: May2 2011 23:18:30)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies刚安装是可以查看php版本的,只是后来我升级了,以为能解决此问题。

/root/lnmp: 行 46: /usr/local/php/sbin/php-fpm: 没有那个文件或目录
这个问题很多人反映,应该引起重视,我的美国的VPS是debian系统的也出现这个问题,虽然重装解决了问题,但我不知到具体的原理,希望作者好好回答下。

[ 本帖最后由 sbmzhcn 于 2011-5-22 16:05 编辑 ]

sbmzhcn 发表于 2011-5-22 16:10:22

https://bbs.vpser.net/thread-1144-1-1.html这个东西我看了好多遍,发现对于不明白的人是废话,对于明白的人也是废话,请说出具体的做法,不要泛泛而谈,如果你不知道如何解决,请不要回复。我急需要最准确的答案或提示。

licess 发表于 2011-5-22 17:49:14

后面的php -v是apt-get安装上的。
apt-get remove php5

configure: error: libjpeg.(a|so) not found.解决方法:
apt-get install libjpeg62 libjpeg62-dev libjpeg-dev

ln -s /usr/lib/x86_64-linux-gnu/libpng* /usr/lib/
ln -s /usr/lib/x86_64-linux-gnu/libjpeg* /usr/lib/
或ln -s /usr/lib/i386-linux-gnu/libpng* /usr/lib/
ln -s /usr/lib/i386-linux-gnu/libjpeg* /usr/lib/

再重新编译安装试试,不行就没办法了。

另外最好提供服务商的名字,我去做测试。
再另外美国VPS 很多,模板也不尽相同,我们手头上的vps、时间精力都有限,只有用户提供更多的反馈信息才能兼容更多的VPS。

sbmzhcn 发表于 2011-5-22 19:17:34

非常感谢你的专业回答!!!
然而我还有问题请教,首先说下我如何解决的。(打开 /root/lnmp0.7-full/ubuntu.sh找到 echo "========================= php + php extensions install ==================="按里面的代码执行的。从 tar zxvf php-5.2.17.tar.gz 开始执行的,下面有具体的)

apt-get remove php5.*   (我这样才卸载,否则说不存在php5)
apt-get install libjpeg62 libjpeg62-dev libjpeg-dev   (提示我已经安装的就是最新版本)
ln -s /usr/lib/i386-linux-gnu/libpng* /usr/lib/
ln -s /usr/lib/i386-linux-gnu/libjpeg* /usr/lib/    (这两部执行过便没有configure: error: libjpeg.(a|so) not found.错误,32位系统执行的应该是这两行吧)

cd /root/lnmp0.7-full/
tar zxvf php-5.2.17.tar.gz
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
cd php-5.2.17/
./buildconf --force
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-discard-path --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --with-mime-magic
make ZEND_EXTRA_LIBS='-liconv'
make install

到这儿就行了。下面的代码没有执行:mkdir -p /usr/local/php/etc
cp php.ini-dist /usr/local/php/etc/php.ini
strip /usr/local/php/bin/php-cgi
cd ../

ln -s /usr/local/php/bin/php /usr/bin/php
ln -s /usr/local/php/bin/phpize /usr/bin/phpize
ln -s /usr/local/php/sbin/php-fpm /usr/bin/php-fpm但是/root/lnmp restart 显示的是这样的root@ubuntu:~/lnmp0.7-full/php-5.2.17# /root/lnmp restart
=========================================================================
Manager for LNMP V0.7,Written by Licess
=========================================================================
LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
This script is a tool to Manage status of lnmp
For more information please visit http://www.lnmp.org

Usage: /root/lnmp {start|stop|reload|restart|kill|status}
=========================================================================
Stoping LNMP...
Nginx program is stop
PHP-FPM program is not runing!
Shutting down MySQL
. *
MySQL program is stop
Starting LNMP...
Nginx start successfully!
Starting php_fpm PHP Warning:PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/memcache.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
done
PHP-FPM start successfully!
Starting MySQL
. *
MySQL start successfully!
root@ubuntu:~/lnmp0.7-full/php-5.2.17# 我想知道这是什么意思Starting php_fpm PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/memcache.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0麻烦告知下!!!

关于你问的主机商,我的是自己的电脑上装的ubuntu11.04 测试用的。 另外我那个出问题的主机是IXwebhosting的debian系统。 那个系统安装lnmp0.7是没有问题的,但是安装lnmpa就出现502, 不过我重新安装后就好了。 如果你想兼容可以研究下。

[ 本帖最后由 sbmzhcn 于 2011-5-22 19:24 编辑 ]

licess 发表于 2011-5-22 20:44:34

pdo_mysql、memcache没有安装,按脚本里的代码安装上,重启一下就行了。
页: [1]
查看完整版本: lnmp0.7在Ubuntu11.04下安装后502错误