"Install PHP" how to compile and install php7,opensuse42.1php7_php tutorial under openSUSE42.1

Source: Internet
Author: User
Tags mcrypt php website

"Install PHP" how to compile the installation under openSUSE42.1 PHP7,OPENSUSE42.1PHP7


First recommend a post PHP 7 Release Date Arrived:will developers adopt PHP 7? -PHP Classes Blog.

In terms of whether to use PHP7, personally, I do not hesitate to use, but the production environment is not my decision, so only in their own development environment to update PHP version. So, what about you?

The author uses the Linux openSUSE42.1 distribution, and YaST has no PHP7 installation package, so it can only be manually compiled and installed. As a PHP developer, I am very much want to be able to learn to compile and install PHP7, tried several times before, but each installation must be online to find all kinds of information, so, the installation after the success of their own installation process and encountered problems recorded, convenient for later access and share to the needs of people.

Download the source code and unzip

To get to the point, to compile and install PHP7, the first of course to download PHP7 source. You can go to GitHub on clone, or you can download it on the PHP website. Download and unzip to the /usr/local/src directory and rename the directory to PHP7. Enter the directory.

Configuring compilation parameters

Build configuration file

./buildconf

Configuration

./Configure \--prefix=/usr/local/PHP7 \--exec-prefix=/usr/local/PHP7 \--bindir=/usr/local/php7/bin \--sbindir=/usr/local/php7/sbin \--includedir=/usr/local/php7/include \--libdir=/usr/local/php7/lib/PHP \--mandir=/usr/local/php7/php/Mans \--with-config-file-path=/usr/local/php7/etc \--with-mysql-sock=/var/run/mysql/mysql.sock \--with-mcrypt=/usr/include \--with-mhash \--with-OpenSSL \--with-mysqli=shared,mysqlnd \--with-pdo-mysql=shared,mysqlnd \--with-GD \--with-iconv \--with-zlib \--enable-Zip \--enable-inline-optimization \--disable-Debug \--disable-rpath \--enable-shared \--enable-XML \--enable-bcmath \--enable-shmop \--enable-sysvsem \--enable-mbregex \--enable-mbstring \--enable-FTP \--enable-gd-native-TTF \--enable-pcntl \--enable-sockets \--with-xmlrpc \--enable-soap \--without-pear \--with-gettext \--enable-session \--with-Curl \--with-jpeg-dir \--with-freetype-dir \--enable-opcache \--enable-fpm \--disable-CGI \--with-fpm-user=nginx \--with-fpm-group=nginx \--without-gdbm \--disable-fileinfo

Parameter description

Prefix PHP7 installation root directory

With-config-file-path PHP7 's configuration file directory

After executing the above configuration command, the result is as follows:

During the execution of the above command, you will encounter some dependencies that are missing, and the dependencies I have encountered are listed below:

Error:

Configure:error:xml2-config not found. Please check your LIBXML2 installation.

Solve:

Install Libxml2-devel

Error:

Configure:WARNING:unrecognized Options:--with-mysql

Solve:

To cancel this option, this option does not exist.

Error:

Configure:error:jpeglib.h not found.

Solve:

Install Libjpeg-devel

Error:

Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.

Solve:

Install Libmcrypt-devel

Error:

for find recode.h anywhere under/usr/usr/local/usr/opt. 

Solve:

Install Librecode-devel

In general, in the configuration of the time encountered without the open yast search, if you have to install, and then recompile see also need those, if not found in YaST, then go online to find Google.

Compiling and installing PHP7

 Make  Make Install

Where make test can be selected. Just an optional step, do not know what the problem, but the author has not yet encountered.

To view the PHP7 directory after successful installation

After the compilation installation is successful, review the PHP7 installation directory ' LS/USR/LOCAL/PHP7 ':

To set the configuration file for PHP7

CP /usr/local/src/php7/php.ini-production/usr/local/php7/etc/php.iniCP /USR/LOCAL/SRC /sapi/fpm/init.d.php-fpm/etc/init.d/php-fpmCP /usr/local/php7/etc/php-fpm.conf.default/usr/ local/php7/etc/php-fpm.confCP /usr/local/php7/etc/php-fpm.d/www.conf.default/usr/local/php7/ Etc/php-fpm.d/www.conf

Setting environment variables

In the last line of the/etc/profile file, add

Export Path=/usr/local/php7/bin:/usr/local/php7/sbin: $PATH


Then execute source/etc/profile

Set the PHP log directory and the PHP-FPM process files (php-fpm.sock) directory

mkdir mkdir chown -R Nginx:nginx php-fpm

Set PHP to boot up

chmod +x/etc/init.d/php-fpmchkconfig php-fpm on

You can use the Chkconfig command to view a list of boot-up services.

Start PHP Service

Service PHP-FPM Start

Via PS aux | grep ' php ' to see if PHP started successfully

At this point, PHP7 is installed successfully, you also start to use PHP7 Bar!

http://www.bkjia.com/PHPjc/1083559.html www.bkjia.com true http://www.bkjia.com/PHPjc/1083559.html techarticle "Install PHP" how to compile the installation under openSUSE42.1 PHP7,OPENSUSE42.1PHP7 first recommend a post PHP 7 Release Date Arrived:will developers adopt PHP 7?-PH P Classes Blog. Inside ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    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.