91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

安裝lamp之 一鍵安裝php

發布時間:2020-06-08 08:10:46 來源:網絡 閱讀:607 作者:lvnian2009 欄目:web開發

#!/bin/sh

#一鍵安裝php

#xiaogao 20190921


#安裝依賴包:

yum install zlib libxml libjpeg freetype libpng gd  curl libiconv  zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel  libxslt-devel openssl* -y


#上面安裝完還是沒有libiconv庫,需要編譯安裝libiconv庫。如果無法下載,就先下載在上傳到/home/lvnian/tools/

[ -e /home/lvnian/tools/ ] || mkdir -p /home/lvnian/tools/

cd /home/lvnian/tools/

#wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

tar zxf libiconv-1.14.tar.gz

cd libiconv-1.14

./configure --prefix=/usr/local/libiconv

make

make install

cd ..


#安裝php

tar zxf php-5.3.27.tar.gz 

cd php-5.3.27


./configure \

--prefix=/application/php5.3.27 \

--with-apxs2=/application/apache/bin/apxs \

--with-mysql=/application/mysql \

--with-xmlrpc \

--with-openssl \

--with-zlib \

--with-freetype-dir \

--with-gd \

--with-jpeg-dir \

--with-png-dir \

--with-iconv=/usr/local/libiconv \

--enable-short-tags \

--enable-sockets \

--enable-zend-multibyte \

--enable-soap \

--enable-mbstring \

--enable-static \

--enable-gd-native-ttf \

--with-curl \

--with-xsl \

--enable-ftp \

--with-libxml-dir


make && make install


#制作軟連接

ln -s /application/php5.3.27/ /application/php

ls /application


##配置配置文件

cp /home/lvnian/tools/php-5.3.27/php.ini-production /application/php/lib/php.ini  


##修改apache配置文件httpd.conf.使其支持php

#到311加下面兩行

#AddType application/x-httpd-php .php .phtml

#AddType application/x-httpd-php-source .phps

sed -n '310,315p' /application/apache/conf/httpd.conf

sed -i '311aAddType application/x-httpd-php .php .phtml\nAddType application/x-httpd-php-source .phps' /application/apache/conf/httpd.conf

sed -n '310,315p' /application/apache/conf/httpd.conf


#修改daemon用戶和組 lvnian

useradd lvnian -s /sbin/nologin -M

sed -i 's/User daemon/User lvnian/g' /application/apache/conf/httpd.conf

sed -i 's/Group daemon/Group lvnian/g' /application/apache/conf/httpd.conf

sed -n '/lvnian/p' /application/apache/conf/httpd.conf


##修改首頁文件

grep  'DirectoryIndex index.html' /application/apache/conf/httpd.conf 

sed -i "s# DirectoryIndex index.html# DirectoryIndex index.php index.html#g" /application/apache/conf/httpd.conf

grep  'DirectoryIndex ' /application/apache/conf/httpd.conf


##重啟apache

/application/apache/bin/apachectl stop

/application/apache/bin/apachectl start


##檢查安裝php是否成功

cd /application/apache/htdocs

cat >>index.php<<EOF

<?php

//$conne=mysql_connect('主機名','用戶','密碼');

$link_id=mysql_connect('localhost','root','lvnian') or mysql_error();


if($conne){

echo "mysql successful by xiaogao!";

}else{

echo mysql_error();

}

?>

<?php

phpinfo();

?>

EOF

###測試lamp環境是否成功

window 打開10.0.0.4

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

和顺县| 鸡泽县| 康马县| 陵川县| 绍兴市| 忻城县| 宿松县| 临潭县| 合江县| 永修县| 理塘县| 西安市| 嘉善县| 淮滨县| 达孜县| 成安县| 宿迁市| 浦县| 江津市| 华池县| 秦皇岛市| 阿巴嘎旗| 建阳市| 平度市| 建宁县| 丹阳市| 武陟县| 太仆寺旗| 张北县| 河间市| 邻水| 邵阳县| 西丰县| 礼泉县| 罗源县| 边坝县| 嵊州市| 湘乡市| 定襄县| 雅江县| 山阳县|