新聞中心
搭建 PHP 7 與 Apache 2.4 的步驟如下:

成都創(chuàng)新互聯(lián)公司主營玉泉街道網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,app開發(fā)定制,玉泉街道h5微信小程序定制開發(fā)搭建,玉泉街道網(wǎng)站營銷推廣歡迎玉泉街道等地區(qū)企業(yè)咨詢
1、安裝 Apache 2.4
更新系統(tǒng)軟件包列表:
“`
sudo aptget update
“`
安裝 Apache 2.4:
“`
sudo aptget install apache2
“`
啟動 Apache 服務(wù):
“`
sudo service apache2 start
“`
確保 Apache 在系統(tǒng)啟動時自動運(yùn)行:
“`
sudo a2enmod rewrite
sudo a2enmod ssl
sudo a2ensite defaultssl
sudo a2dissite 000default
sudo a2enmod cgi
sudo a2enmod userdir
sudo a2enmod env
sudo a2enmod mime
sudo a2enmod log_config
sudo a2enmod access_compat
sudo a2enmod actions
sudo a2enmod deflate
sudo a2enmod headers
sudo a2enmod mimemagic
sudo a2enmod negotiation
sudo a2enmod vhost_alias
sudo a2enmod rewrite
sudo a2enmod ssl
sudo a2ensite defaultssl
sudo a2dissite 000default
“`
重啟 Apache 服務(wù):
“`
sudo service apache2 restart
“`
2、安裝 PHP 7
更新系統(tǒng)軟件包列表:
“`
sudo aptget update
“`
安裝 PHP 7:
“`
sudo aptget install libapache2modphp7.0 php7.0cli php7.0common php7.0curl php7.0json php7.0mysqlnd php7.0opcache php7.0readline php7.0xml php7.0mbstring
“`
確保 PHP 在系統(tǒng)啟動時自動運(yùn)行:
“`
echo "extension=php7.0" | sudo tee /etc/apache2/modsavailable/php7.0.conf > /dev/null &&
sudo a2enmod php7.0 &&
sudo service apache2 restart &&
php v | grep PHP | grep "PHP Version =>" | cut d " " f3 | xargs I{} echo "LoadModule {} /usr/lib/apache2/modules/libphp7.so" | sudo tee a /etc/apache2/modsavailable/php7.0.load &&
sudo service apache2 restart &&
php m | grep "^[azAZ]+$" | xargs I{} echo "Include {}/conf/apache2/*.conf" | sudo tee a /etc/apache2/httpd.conf &&
sudo service apache2 restart &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/apache2/php.ini &&
sudo service apache2 restart &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/cli/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/cgi/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpm/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/cliserver/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/cgibin/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpmfcgi/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpmigbinary/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpmintl/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpmjson/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpmopcache/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpmpdo_mysql/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpmphar/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpmposix/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpmreadline/php.ini &&
php ini | grep "Loaded Configuration" | cut d "=" f2 | xargs I{} echo "include=find {} name '*.ini'" | sudo tee a /etc/php/7.0/fpmsoapclientguzzlehttpguzzlerequestwarningsmonologredissodiumsqlite3tokenizerwddxxmlwriterxdebugziparchivezlib /etc/apache2/confenabled &&
rm modsavailable/* &&
apt autoremove &&
apt autoclean &&
apt update &&
apt upgrade &&
systemctl restart lighttpd &&
systemctl restart memcached &&
systemctl restart postfix &&
systemctl restart dovecot &&
systemctl restart roundcube &&
systemctl restart opendkim &&
systemctl restart fail2ban &&
systemctl restart clamav &&
systemctl restart spamassassin &&
systemctl restart saslauthd &&
systemctl restart [email protected] &&
分享標(biāo)題:如何搭建php7與apache2.4
鏈接地址:http://fisionsoft.com.cn/article/cocoeed.html


咨詢
建站咨詢
