fedora apache php,Fedora 20下安装搭建LAMP环境Apache+MySQL+PHP
1.安裝數(shù)據(jù)庫,有兩個數(shù)據(jù)庫可選:MySQL/MariaDB
yum?install?mysql?mysql-server
為MySQL創(chuàng)建啟動連接 (這樣 MySQL 將隨系統(tǒng)自動啟動)并啟動 MySQL服務:
systemctl?enable?mysqld.service
注意:如果您收到這樣的錯誤
Failed to issue method call: No such file or directory
使用下面的命令
systemctl?enable?mariadb.service
進一步啟動mysql的服務
systemctl?start?mysqld.service
運行
mysql_secure_installation
設置root用戶密碼(否則任何人都可以訪問MySQL數(shù)據(jù)庫!):
mysql_secure_installation
................
2.安裝Apache2服務器
運行下面的命令:
yum?install?httpd
現(xiàn)在配置系統(tǒng)在開機時啟動Apache…
systemctl?enable?httpd.service
并且啟動Apache:
systemctl?start?httpd.service
3.安裝 PHP5
安裝 PHP5 和 Apache PHP5 模塊,運行命令:
yum?install?php
重啟 Apache :
systemctl?restart?httpd.service
測試PHP5/獲取關于PHP5安裝詳細信息
在默認根目錄下創(chuàng)建一個探針文件:
vi?/var/www/html/info.php
4.讓PHP5支持MySQL
yum?install?php-mysqlnd?php-mssql?php-opcache
在重啟Apache2:
systemctl?restart?httpd.service
5.安裝phpMyAdmin來管理Mysql
yum?install?phpmyadmin
vi?/etc/httpd/conf.d/phpMyAdmin.conf
#??????#?????#?Apache?2.4????#????????#???????Require?ip?127.0.0.1????#???????Require?ip?::1????#????????#??????#??????#?????#?Apache?2.2??????#?????Order?Deny,Allow??????#?????Deny?from?All??????#?????Allow?from?127.0.0.1??????#?????Allow?from?::1??????#???????Require?all?granted
SELINUX 模式(php沒有mkdir等權限)
查看SELinux狀態(tài):
1、/usr/sbin/sestatus -v ? ? ?##如果SELinux status參數(shù)為enabled即為開啟狀態(tài)
SELinux status: ? ? ? ? ? ? ? ? enabled
2、getenforce ? ? ? ? ? ? ? ? ##也可以用這個命令檢查
關閉SELinux:
1、臨時關閉(不用重啟機器):
setenforce 0 ? ? ? ? ? ? ? ? ?##設置SELinux 成為permissive模式
setenforce 1 設置SELinux 成為enforcing模式
2、修改配置文件需要重啟機器:
修改/etc/selinux/config 文件
將SELINUX=enforcing改為SELINUX=disabled
重啟機器即可
總結
以上是生活随笔為你收集整理的fedora apache php,Fedora 20下安装搭建LAMP环境Apache+MySQL+PHP的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php pdo连接不成功,php – 为
- 下一篇: php+mysql文件上传,使用PHP将