CentOS 7 for ARM 安裝一鍵Lnmp失敗,centoslnmp

來源:互聯網
上載者:User

CentOS 7 for ARM 安裝一鍵Lnmp失敗,centoslnmp

  背景
  
  前面把樹莓派裝上了CentOS 7,趁著國慶放假回來趕緊把服務端環境搭起來,為了方便就準備用一鍵lnmp快速部署一個,結果死活安裝不成功...
  
  報錯
  
  按照以往的經驗進行安裝,在我的小樹莓派上安裝實在是慢,畢竟需要編譯,CPU不給力只能慢慢的等待編譯完成,吃個午飯回來發現似乎已經完成了,然而卻失敗了,報錯資訊如下

============================== Check install ==============================Checking ...Nginx: OKMariaDB: OKError: PHP install failed.Sorry, Failed to install LNMP!Please visit http://bbs.vpser.net/forum-25-1.html feedback errors and logs.You can download /root/lnmp-install.log from your server,and upload lnmp-install.log to LNMP Forum.

    PHP安裝失敗了,報錯不要緊,再來一次看下啥問題,使用./upgrade.sh指令碼可以重新安裝,然而繼續報錯

+-------------------------------------------+|    Manager for LNMP, Written by Licess    |+-------------------------------------------+|              http://lnmp.org              |+-------------------------------------------+Starting LNMP...Starting nginx...  doneStarting MySQL.... SUCCESS! /bin/lnmp: line 27: /etc/init.d/php-fpm: No such file or directory======== upgrade php failed ======upgrade php log: /root/upgrade_lnmp_php.logYou upload upgrade_lnmp_php.log to LNMP Forum for help.

  發現
  
  仔細查看安裝日誌,發現了關鍵資訊

configure: error: Please reinstall the libcurl distribution -    easy.h should be in <curl-dir>/include/curl/make: *** No targets specified and no makefile found.  Stop.make: *** No rule to make target `install'.  Stop.

  這裡有個error,說是“請安裝libcurl”,奇怪了,我在VPS上安裝的時候咋沒碰到這個問題呢,難道是CentOS for 樹莓派版本閹割了這個玩意?
  
  解決
  
  按照錯誤提示安裝,嘗試使用yum直接裝,然而包管理器裡面並沒有發現這個東西,找到官網上直接下載編譯安裝

     CentOS 編譯SVNdocx http://www.gooln.com/document/19937.html

wget https://curl.haxx.se/download/curl-7.50.3.tar.gztar zvxf curl-7.50.3.tar.gzcd curl-7.50.3./configure --enable-sharedmakemake install

  經過漫長的編譯終於編譯安裝成功了
  
  繼續嘗試安裝PHP,這回算是正常進行編譯PHP了

Generating filesconfigure: creating ./config.statuscreating main/internal_functions.ccreating main/internal_functions_cli.c+--------------------------------------------------------------------+| License:                                                           || This software is subject to the PHP License, available in this     || distribution in the file LICENSE.  By continuing this installation || process, you are bound by the terms of this license agreement.     || If you do not agree with the terms of this license, you must abort || the installation process at this point.                            |+--------------------------------------------------------------------+Thank you for using PHP.config.status: creating php5.specconfig.status: creating main/build-defs.hconfig.status: creating scripts/phpizeconfig.status: creating scripts/man1/phpize.1config.status: creating scripts/php-configconfig.status: creating scripts/man1/php-config.1config.status: creating sapi/cli/php.1config.status: creating sapi/fpm/php-fpm.confconfig.status: creating sapi/fpm/init.d.php-fpmconfig.status: creating sapi/fpm/php-fpm.serviceconfig.status: creating sapi/fpm/php-fpm.8config.status: creating sapi/fpm/status.htmlconfig.status: creating sapi/cgi/php-cgi.1config.status: creating ext/phar/phar.1config.status: creating ext/phar/phar.phar.1config.status: creating main/php_config.hconfig.status: executing default commands

  經過漫長的編譯,終於.....
  
  編譯完成了,但是...

+-------------------------------------------+|    Manager for LNMP, Written by Licess    |+-------------------------------------------+|              http://lnmp.org              |+-------------------------------------------+Starting LNMP...Starting nginx...  doneStarting MySQL...... SUCCESS! Starting php-fpm Failed loading /usr/local/zend/ZendGuardLoader.so:  /usr/local/zend/ZendGuardLoader.so: cannot open shared object file: No such file or directory done======== upgrade php completed ======

似乎還是有些問題,不過問題不大,看起來像是某個擴充丟了,到這個目錄查看下到底有沒有這個東西

[root@rpi2 ~]# ls /usr/local/zend/                   ZendGuardLoader.so

  發現是有這個東西,真是神奇,通過搜尋發現lnmp論壇上還真有人遇到過這個問題,文章地址 http://bbs.vpser.net/thread-12810-1-1.html,作者說是系統dns的問題,應該是下載回來的東西損壞了,先不管,可以直接在php.ini裡面注釋掉這個,也或者直接去下載完整的重新放進去就可以了。
  
  後記
  
  重新從zend官方下載了32位的so檔案放進去發現依然不行,嘗試重新安裝PHP的預設版本5.4.45,現在還在編譯...
  
  更新
  
  經過一番波折終於搞定了,編譯完PHP之後發現還是失敗了,錯誤資訊如下

+-------------------------------------------+|    Manager for LNMP, Written by Licess    |+-------------------------------------------+|              http://www.gooln.com              |+-------------------------------------------+Starting LNMP...Starting nginx...  doneStarting MySQL..... SUCCESS! Starting php-fpm /etc/init.d/php-fpm:行57: /usr/local/php/sbin/php-fpm: 沒有那個檔案或目錄 failed======== upgrade php failed ======upgrade php log: /root/upgrade_lnmp_php.logYou upload upgrade_lnmp_php.log to LNMP Forum for help.顯示的是找不到php-fpm這個檔案,於是我想尋找下這個檔案在哪$ whereis php-fpmphp-fpm: /usr/bin/php-fpm /usr/sbin/php-fpm /etc/php-fpm.conf /etc/php-fpm.d /usr/share/man/man8/php-fpm.8.gz通過尋找發現確實不在那個目錄下面,這個簡單,直接從/usr/sbin下面把php-fpm複製過去就好了
$ cd /usr/local/php/$ lsetc  php-fpm$ sudo mkdir sbin$ sudo mv php-fpm sbin/$ lnmp restartError: You must be root to run this script![kbdancerrpi@rpi2 php]$ sudo lnmp restart+-------------------------------------------+|    Manager for LNMP, Written by Licess    |+-------------------------------------------+|              http://www.gooln.com              |+-------------------------------------------+Stoping LNMP...Stoping nginx...  doneShutting down MySQL. SUCCESS! Gracefully shutting down php-fpm warning, no pid file found - php-fpm is not running ?Starting LNMP...Starting nginx...  doneStarting MySQL..... SUCCESS! Starting php-fpm [01-Jan-1970 13:18:55] ERROR: failed to open error_log (/usr/local/php/var/log/php-fpm.log): No such file or directory (2)[01-Jan-1970 13:18:55] ERROR: failed to post process the configuration[01-Jan-1970 13:18:55] ERROR: FPM initialization failed failed

沒錯,繼續報錯,根據提示來

$ cd /usr/local/php/$ sudo mkdir var$ cd var/$ sudo mkdir log$ cd log/$ ls$ sudo touch php-fpm.log$ sudo lnmp restart+-------------------------------------------+|    Manager for LNMP, Written by Licess    |+-------------------------------------------+|              http://lnmp.org              |+-------------------------------------------+Stoping LNMP...Stoping nginx...  doneShutting down MySQL. SUCCESS! Gracefully shutting down php-fpm warning, no pid file found - php-fpm is not running ?Starting LNMP...Starting nginx...  doneStarting MySQL..... SUCCESS! Starting php-fpm [01-Jan-1970 13:20:18] ERROR: Unable to create the PID file (/usr/local/php/var/run/php-fpm.pid).: No such file or directory (2)[01-Jan-1970 13:20:18] ERROR: FPM initialization failed failed

依然報錯,繼續

$ cd ..$ lslog$ sudo mkdir run$ sudo lnmp restart+-------------------------------------------+|    Manager for LNMP, Written by Licess    |+-------------------------------------------+|              http://lnmp.org              |+-------------------------------------------+Stoping LNMP...Stoping nginx...  doneShutting down MySQL. SUCCESS! Gracefully shutting down php-fpm warning, no pid file found - php-fpm is not running ?Starting LNMP...Starting nginx...  doneStarting MySQL..... SUCCESS! Starting php-fpm  done

OK,終於搞定了,真是曲折啊,估計lnmp作者沒有測試過lnmp跑在ARM上會不會出問題,希望能夠改進...

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.