VPS侦探论坛

 找回密码
 注册
查看: 10193|回复: 4

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

[复制链接]
发表于 2011-5-22 16:01:50 | 显示全部楼层 |阅读模式



内核: 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,无法上传。说下错误信息吧。错误信息:
  1. root@ubuntu:~/lnmp0.7-full/php-5.2.17# /root/lnmp restart
  2. =========================================================================
  3. Manager for LNMP V0.7  ,  Written by Licess
  4. =========================================================================
  5. LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
  6. This script is a tool to Manage status of lnmp
  7. For more information please visit http://www.lnmp.org [local]1[/local]

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

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

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

  28. ln -s /usr/local/php/bin/php /usr/bin/php
  29. ln -s /usr/local/php/bin/phpize /usr/bin/phpize
  30. ln -s /usr/local/php/sbin/php-fpm /usr/bin/php-fpm

  31. cd $cur_dir
  32. tar zxvf memcache-3.0.5.tgz
  33. cd memcache-3.0.5/
  34. /usr/local/php/bin/phpize
  35. ./configure --with-php-config=/usr/local/php/bin/php-config
  36. make && make install
  37. cd ../

  38. tar zxvf PDO_MYSQL-1.0.2.tgz
  39. cd PDO_MYSQL-1.0.2/
  40. /usr/local/php/bin/phpize
  41. ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
  42. make && make install
  43. cd ../

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

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

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

  70. ;ionCube

  71. [Zend Optimizer]
  72. zend_optimizer.optimization_level=1
  73. zend_extension="/usr/local/zend/ZendOptimizer.so"
  74. EOF

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

另:php -v 执行情况
  1. root@ubuntu:~/lnmp0.7-full/php-5.2.17# php -v
  2. PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0
  3. PHP
  4. Warning:  PHP Startup: Unable to load dynamic library
  5. '/usr/lib/php5/20090626+lfs/mysql.so' -
  6. /usr/lib/php5/20090626+lfs/mysql.so: cannot open shared object file: No
  7. such file or directory in Unknown on line 0
  8. PHP Warning:  PHP
  9. Startup: Unable to load dynamic library
  10. '/usr/lib/php5/20090626+lfs/mysqli.so' -
  11. /usr/lib/php5/20090626+lfs/mysqli.so: cannot open shared object file: No
  12. such file or directory in Unknown on line 0
  13. PHP Warning:  PHP
  14. Startup: Unable to load dynamic library
  15. '/usr/lib/php5/20090626+lfs/pdo_mysql.so' -
  16. /usr/lib/php5/20090626+lfs/pdo_mysql.so: cannot open shared object file:
  17. No such file or directory in Unknown on line 0
  18. PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch (cli) (built: May  2 2011 23:18:30)
  19. Copyright (c) 1997-2009 The PHP Group
  20. 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 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-5-22 16:10:22 | 显示全部楼层


https://bbs.vpser.net/thread-1144-1-1.html  这个东西我看了好多遍,发现对于不明白的人是废话,对于明白的人也是废话,请说出具体的做法,不要泛泛而谈,如果你不知道如何解决,请不要回复。我急需要最准确的答案或提示。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 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。
美国VPS推荐: 遨游主机LinodeLOCVPSKVMLAVPS2EZ搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 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

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

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

  8. Usage: /root/lnmp {start|stop|reload|restart|kill|status}
  9. =========================================================================
  10. Stoping LNMP...
  11. Nginx program is stop
  12. PHP-FPM program is not runing!
  13. Shutting down MySQL
  14. . *
  15. MySQL program is stop
  16. Starting LNMP...
  17. Nginx start successfully!
  18. 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
  19. 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
  20. done
  21. PHP-FPM start successfully!
  22. Starting MySQL
  23. . *
  24. MySQL start successfully!
  25. root@ubuntu:~/lnmp0.7-full/php-5.2.17#
复制代码
我想知道这是什么意思
  1. 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
  2. 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 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-5-22 20:44:34 | 显示全部楼层

pdo_mysql、memcache没有安装,按脚本里的代码安装上,重启一下就行了。

美国VPS、VPN、域名代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2021-5-15 04:27 , Processed in 0.082460 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表