Instructor Shen Yi's notes for ubuntu fast learning (2) -- combined compilation and installation of apache2.4 and php7 under ubuntu16.04, and install the PDOmysql extension and php7pdomysql
1. Compile and install apache2.4.20
1 Step 1:./configure -- prefix =/usr/local/httpd -- enable-so 2 Step 2: make 3 Step 3: sudo make install
2. Compile and install libiconv
Download it here and compile and install the http://www.gnu.org/software/libiconv/#TOCdownloading
1 Step 1:./configure -- prefix =/usr/local 2 Step 2: make 3 Step 3: sudo make install
3. manually modify the compilation and report an error
The http://www.itkb.ro/userfiles/file/libiconv-glibc-2.16.patch.gz has a patch file.
Open/srclib/stdio. h and find the error point: manually change the file content
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16) _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #endif
4. Execute The sudo ldconfig command. The instructor explained it as refreshing the dynamic link library cache.
5. Compile server guard PHP7.0
If PHP has been compiled before, make clean must be executed first (the result of the last compilation should be cleared first)
Let's continue:
Step 1 :. /configure -- prefix =/usr/local/php -- with-config-file-path =/usr/local/php/conf -- with-apxs2 =/usr/local/httpd/bin/ apxs -- with-iconv-dir =/usr/local/lib, this step is to generate Makefile Step 2: Execute: make ZEND_EXTRA_LIBS = '-liconv' and finally: sudo make install
6. During installation, A/usr/local/httpd/modules/libphp7.so file is automatically copied.
The intimate installer will automatically modify our apache configuration file and add this line of LoadModule php7_module modules/libphp7.so
Join again
AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps
7. view the modules loaded by apache
sudo ./apachectl restart ./apachectl -t -D DUMP_MODULES
8. php7 server guard pdo mysql Development Exhibition
Step 1: Clear the prepared file: make clean.
Step 2: Go to/usr/local/php/bin to view the php compilation parameters in cat php_config.
Step 3: copy the parameter and add the parameter (red indicates the new parameter)
-- Prefix =/usr/local/php -- with-config-file-path =/usr/local/php/conf -- with-apxs2 =/usr/local/httpd/bin/apxs -- with-iconv-dir =/usr/local/lib -- enable-mysqlnd -- with-pdo-mysql = mysqlnd
Step 4: make ZEND_EXTRA_LIBS = '-liconv'
Step 5: sudo make install
Finally, add extension = pdo_mysql.so to php. ini.
Previous section: Instructor Shen Yi's notes on ubuntu fast learning (1) -- install Flash Player and configure the Chinese Input Method and Common commands