Window:
一、XAMPP
https://www.apachefriends.org/index.htmlphp
二、WampServer
http://www.wampserver.com/html
Linux
Centos安裝apache,mysql,php環境mysql
yum -y install httpd php mysql mysql-server php-mysql php-devel mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysqlweb
這是系統默認版本的,若是想升級到更高,例如php5.6能夠使用命令:
更新源:
CentOS/RHEL 7.x:redis
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm sql
CentOS/RHEL 6.x:apache
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm centos
刪除以前安裝的phpdom
yum remove php-common
yum install php56w php56w-mysql php56w-dom php56w-gd php56w-bcmath php56w-mbstring php56w-ldap php56w-wddx php56w-xmlreader php56w-xmlrpc php56w-xmlwriter php56w-xsl php56w-xsl php56w-devel memcached
apache,mysql服務啓動和關閉命令
service httpd start
service httpd stop
service mysql start
service mysql stop
php56-* 可用的擴展參考這裏:
https://webtatic.com/packages/php56/
Mac
Mac OS X 內置Apache 和 PHP,使用起來很是方便。
終端運行:
sudo apachectl start
mysql的安裝
訪問MySQL的官網,而後在頁面中會看到"MySQL Community Server"下方有一個"download"點擊。
經常使用擴展安裝
Redis
centos下面:
pecl的安裝請看:https://blog.iw3c.com/archive/994/
pecl install redis
echo extension=redis.so >> /etc/php.ini
若是php.php不在默認位置,經過 php -i | grep "php.ini" 查看 php.ini的具體所在位置。
Window:去https://pecl.php.net/package/redis下載最新的DLL包,放後放到PHP文件下的ext目錄中,或者經過集成環境更智能的添加擴展
Mongo
centos下面:
pecl install mongo
echo extension=mongo.so >> /etc/php.ini
Memcached
centos下面:
pecl install memcachedecho extension=memcached.so >> /etc/php.ini