<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Linux搭建PHP+MySQL+Apache環境

      環境:

      CentOS7 64位

      Linux localhost.localdomain 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

      MySQL詳細安裝可參考:http://www.rzrgm.cn/angelasp/p/4308526.html

      Apache詳細安裝可參考:http://www.rzrgm.cn/angelasp/p/6446004.html

       

      一、下載文件

      1、php下載地址:http://php.net/downloads.php  版本:php-5.6.3.tar.gz

      2、libxml2下載地址:http://download.chinaunix.net/download/0007000/6095.shtml  版本:libxml2-2.7.4.tar.gz

      3、apache2下載地址:http://httpd.apache.org/  版本:httpd-2.4.10.tar.gz

      4、apr與apr-util下載地址:http://apr.apache.org   版本:apr-1.5.1.tar.gz / apr-util-1.5.4.tar.gz

      5、pcre下載地址:http://sourceforge.net/projects/pcre/files/pcre/  版本:pcre-8.36.tar.gz

      6、MySQL下載地址:http://dev.mysql.com/downloads/mysql/5.1.73.html  

      MySQL-devel-community-5.1.73-1.rhel5.x86_64.rpm

      MySQL-client-community-5.1.73-1.rhel5.x86_64.rpm

      MySQL-server-community-5.1.73-1.rhel5.x86_64.rpm

      下載

       

      二、安裝MySQL

      1、二進制安裝MySQL,步驟如下:

      [root@vm15 mysql]# rpm -ivh MySQL-server-community-5.1.73-1.rhel5.x86_64.rpm
      Preparing... ########################################### [100%]
      1:MySQL-server-community ########################################### [100%]

      PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
      To do so, start the server, then issue the following commands:

      /usr/bin/mysqladmin -u root password 'new-password'
      /usr/bin/mysqladmin -u root -h vm15.example.com password 'new-password'

      Alternatively you can run:
      /usr/bin/mysql_secure_installation

      which will also give you the option of removing the test
      databases and anonymous user created by default. This is
      strongly recommended for production servers.

      See the manual for more instructions.

      Please report any problems with the /usr/bin/mysqlbug script!

      Starting MySQL.. SUCCESS!
      Giving mysqld 2 seconds to start

      [root@memcache mysql]# rpm -ivh MySQL-client-community-5.1.73-1.rhel5.x86_64.rpm
      Preparing... ########################################### [100%]
      1:MySQL-client-community ########################################### [100%]

      [root@vm15 mysql]# rpm -ivh MySQL-devel-community-5.1.73-1.rhel5.x86_64.rpm
      Preparing... ########################################### [100%]
      1:MySQL-devel-community ########################################### [100%]

       

      2、驗證安裝是否成功

      [root@vm15 mysql]# rpm -qa |grep MySQL
      MySQL-client-community-5.1.73-1.rhel5.x86_64
      MySQL-devel-community-5.1.73-1.rhel5.x86_64
      MySQL-server-community-5.1.73-1.rhel5.x86_64

       

      [root@vm15 mysql]# mysql

      出現了“mysql>”提示符,恭喜你,安裝成功!

       

      三、安裝Apache

      參考:http://www.rzrgm.cn/angelasp/p/6446004.html

       

      四、安裝libxml2

      將下載的libxml2-2.7.4.tar.gz文件上傳至/usr/local

      [root@vm15 local]# mkdir -p libxml2
      [root@vm15 local]# tar -zxvf libxml2-2.7.4.tar.gz
      [root@vm15 local]# cd libxml2-2.7.4
      [root@vm15 libxml2-2.7.4]# ./configure --prefix=/usr/local/libxml2
      [root@vm15 libxml2-2.7.4]# make
      [root@vm15 libxml2-2.7.4]# make install

      如果安裝成功以后,在/usr/local/libxml2/目錄下將生成bin、include、lib和share四個目錄。在后面安裝PHP5源代碼包的配置時,會通過在configure命令的選項中加上"--with-libxml-dir=/usr/ local/libxml2"選項,用于指定安裝libxml2庫文件的位置。

       

      五、安裝php

      將下載的php-5.6.3.tar.gz文件上傳至/usr/local

      [root@vm15 local]# mkdir -p php
      [root@vm15 local]# tar -zxvf php-5.6.3.tar.gz
      [root@vm15 local]# cd php-5.6.3
      [root@vm15 php-5.6.3]#./configure --prefix=/usr/local/php --with-mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/libxml2

      這里需要補充一下 網上基本是這樣子

      后來連接數據庫出現了些問題如果鏈接不上數據庫可以是試試這個:

      ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql --with-mysqli --with-pdo-mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-gd --with-jpeg-dir --with-png-dir --enable-mbstring --enable-xml --with-xpm-dir=/usr --enable-fpm --with-freetype-dir --with-mcrypt --with-mhash  --with-gettext --enable-pdo --with-libxml-dir --with-zlib-dir

      出現以下信息表示編譯成功

      ..
      checking for external oniguruma... no
      checking for mcrypt support... no
      checking for MSSQL support via FreeTDS... no
      checking for MySQL support... yes
      checking for specified location of the MySQL UNIX socket... no
      configure: error: Cannot find MySQL header files under /usr/local/mysql.
      Note that the MySQL client library is not bundled anymore!

      creating libtool
      appending configuration tag "CXX" to libtool

      Generating files
      configure: creating ./config.status
      creating main/internal_functions.c
      creating 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.spec
      config.status: creating main/build-defs.h
      config.status: creating scripts/phpize
      config.status: creating scripts/man1/phpize.1
      config.status: creating scripts/php-config
      config.status: creating scripts/man1/php-config.1
      config.status: creating sapi/cli/php.1
      config.status: creating sapi/cgi/php-cgi.1
      config.status: creating ext/phar/phar.1
      config.status: creating ext/phar/phar.phar.1
      config.status: creating main/php_config.h
      config.status: executing default commands

      [root@vm15 php-5.6.3]#make

      [root@vm15 php-5.6.3]#make install

      安裝成功。

       

      六、配置php

      1、配置php.ini,只需要把php-5.6.3安裝包中的php.ini-production拷貝到/usr/local/php/lib/下

      [root@vm15 php-5.6.3]# cp php.ini-production /usr/local/php/lib/php.ini

      2、配置 httpd.conf 讓apache支持PHP:

      # vi /usr/local/apache/conf/httpd.conf

      找到 AddType application/x-gzip .gz .tgz 在其下添加如下內容

      AddType application/x-compress .Z
      AddType application/x-gzip .gz .tgz
      AddType application/x-httpd-php .php
      AddType application/x-httpd-php-source .phps

      3、在DirectoryIndex增加 index.php,以便Apache識別PHP格式的index

      # vi /usr/local/apache/conf/httpd.conf

      <IfModule dir_module>
      DirectoryIndex index.html index.php
      </IfModule>

      七、重啟Apache

      [root@vm15 mysql]# /usr/local/apache2/bin/apachectl start

      (一定要重啟)

       

      八、測試php是否成功安裝

      寫一個php測試頁info.php,放到/usr/local/apache2/htdocs中。

      <?php

      phpinfo();

      ?>;

      在瀏覽器中輸入:服務器地址/info.php。通過phpinfo()可以查看很多信息,比如php.ini的存放路徑,以及所有擴展組件等,很強大。

       

      如果能正常顯示出php的信息,則說明Apche+Mysql+PHP安裝成功!

       

      九、安裝遇到的問題

      1、安裝MySQL時,報下面的錯誤:

      [root@memcache mysql]# rpm -ivh MySQL-server-community-5.1.73-1.rhel5.x86_64.rpm
      Preparing... ########################################### [100%]
      file /usr/share/mysql/charsets/README from install of MySQL-server-community-5.1.73-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
      file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-community-5.1.73-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
      file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-community-5.1.73-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
      file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-community-5.1.73-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
      file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-community-5.1.73-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
      file /usr/share/mysql/charsets/cp1251.xml from install of MySQL-server-community-5.1.73-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
      file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-community-5.1.73-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64

      解決方法:yum remove mysql-libs-5*

       

      2、configure php時,報錯:

      Configuring SAPI modules
      checking for AOLserver support... no
      checking for Apache 1.x module support via DSO through APXS... configure: error: You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropriate switch --with-apxs2

      解決方法:./configure --prefix=/usr/local/php --with-mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/libxml2

       

      3、安裝apr時,報錯rm: cannot remove `libtoolT': No such file or directory

      解決方法:

      直接打開/usr/local/apr-1.5.1/configure 把 $RM“$cfgfile” 那行刪除掉
      $RM“$cfgfile” 大約在 42302行

      [root@vm15 apr-1.5.1]#grep -n RM configure

      [root@vm15 apr-1.5.1]#sed -i '/$RM "$cfgfile"/d' configure

      然后再重新運行 ./configure --prefix=/usr/local/apr 就可以了.

       

      4、[root@vm15 php-5.6.3]#./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/libxml2

      ..
      checking for external oniguruma... no
      checking for mcrypt support... no
      checking for MSSQL support via FreeTDS... no
      checking for MySQL support... yes
      checking for specified location of the MySQL UNIX socket... no
      configure: error: Cannot find MySQL header files under /usr/local/mysql.
      Note that the MySQL client library is not bundled anymore!

      解決方法:

      [root@localhost php-5.5.6]# find / -name mysql.h
      /usr/include/mysql/mysql.h

      查找到mysql.h文件,我們更改參數為--with-mysql,如果沒有的話,請安裝mysql-devel包,

      posted @ 2017-02-26 21:41  Angelasp  閱讀(2497)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 欧美不卡无线在线一二三区观| 军人粗大的内捧猛烈进出视频| 九九热在线免费播放视频| 亚洲男人天堂av在线| 无码激情亚洲一区| 精品精品国产国产自在线| 国产国拍亚洲精品永久软件| 免费人成自慰网站| 日韩一区二区三区亚洲一| 国产精品午夜福利资源| 国产va在线观看免费| 国语精品自产拍在线观看网站| 亲子乱aⅴ一区二区三区| 狠狠色噜噜狠狠狠狠777米奇| 久久久久无码中| 日韩伦理片| 在线精品自拍亚洲第一区| 精品无码午夜福利理论片| 张家港市| 精品偷自拍另类精品在线| 亚洲精品美女一区二区| 浓毛老太交欧美老妇热爱乱| 成人乱码一区二区三区四区| 不卡国产一区二区三区| 亚洲精品一区二区三区大桥未久| 婷婷六月天在线| 亚洲特黄色片一区二区三区| 日韩深夜福利视频在线观看| 欧美日产国产精品日产| 国产成人精品三上悠亚久久| 人妻中文字幕精品系列| 中文字幕精品人妻丝袜| 图片区小说区av区| 亚洲精品久久久久久下一站| 精品国产迷系列在线观看| 国产亚洲精品福利在线无卡一| 诱人的老师hd中文字幕| 万载县| 亚洲精品无码av人在线观看| 福利一区二区不卡国产| 人人妻一区二区三区|