In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to install the coexistence of php7 and php5, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Install php7 and start coexisting with php5
Before setting up the lamp environment on the server, I want to switch to the stronger nginx as the server software, and I want to upgrade php5 to php7.
There is no need to elaborate on the installation of nginx: sudo apt-get install nginx, modify the port of apache before starting ng.
Install php7
The source code is downloaded from http://php.net/downloads.php and decompressed.
# cd php7***#. / configure-- prefix=/usr/local/php7-- with-config-file-path=/usr/local/php7/etc-- with-mcrypt=/usr/include-- with-mysql=mysqlnd-- with-pdo-mysql=mysqlnd-- with-gd-- with-iconv-- with-zlib-- enable-xml-- enable-bcmath-- enable-shmop-- enable-sysvsem-- enable-inline-optimization-enable-mbregex-- enable-fpm-- enable-mbstring -- enable-ftp-- enable-gd-native-ttf-- with-openssl-- enable-pcntl-- enable-sockets-- with-xmlrpc-- enable-zip-- enable-soap-- without-pear-- with-gettext-- enable-session-- with-curl-- with-jpeg-dir-- with-freetype-dir-- enable-opcache# make# make install
To avoid conflicts with 5, folders are all php7, depending on the installation response that reported an error during installation.
Docking nginx
Nginx itself cannot handle php scripts and needs to be sent to the php interpreter for processing. Nginx generally sends the request to the fastcgi management process for processing, and the fascgi management process selects the processing result of the CGI child process and returns the nginx.
# cp php.ini-production / usr/local/php7/etc/php.ini# cp sapi/fpm/init.d.php-fpm / etc/init.d/php7-fpm# chmod + x / etc/init.d/php7-fpm# cp / usr/local/php7/etc/php-fpm.conf.default / usr/local/php7/etc/php-fpm.conf# cp / usr/local/php7/etc/php-fpm.d/www.conf.default / usr/local/php7/etc/php- Fpm.d/www.conf starts php-fpm# service php7-fpm start
If you encounter that the log file path does not exist, create it manually and give you write permission.
# service php7-fpm startStarting php-fpm [07-Apr-2016 11:16:11] ERROR: [pool www] cannot get gid for group 'nobody' [07-Apr-2016 11:16:11] ERROR: FPM initialization failed failed
When you encounter this error, add a nobody group groupadd nobody and restart it.
Configuration of nginx
This is to access the php file to become a download file because ng is not configured for response handling.
Location\ .php$ {fastcgi_pass 127.0.0.1 fastcgi_pass 9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params } Thank you for reading this article carefully. I hope the article "how to install the coexistence of php7 and php5" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.