安装 PHP5.6
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm; rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm; yum list --enablerepo=remi --enablerepo=remi-php56 | grep php; yum install --enablerepo=remi --enablerepo=remi-php56 php php-mysql php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-common; php -v;
//修改 /etc/php.ini 文件后重启php
/etc/init.d/php-fpm restart //重启php
php -v 查看php版本
安装 apache2.2.15
yum -y install httpd
service httpd restart
chkconfig httpd on //设置apache开机自动开启
/usr/sbin/httpd -v //查看apache版本
cp /usr/sbin/httpd /usr/local/bin
httpd -v /查看apache版本
安装 mysql
yum -y install mysql
/etc/init.d/mysqld start
cp /etc/init.d/mysqld /usr/bin
mysqld start //开启mysql
chkconfig mysqld on //开机自动启动
mysql -uroot -p 进入mysql
use mysql;
update user set password = PASSWORD("xxxxxx") where user="root";//设置mysql root 密码
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION; //允许所有ip远程登录
FLUSH PRIVILEGES;
exit;
安装 laravel5.1
要求php版本高于5.5.9
把windows下写好的laravel代码以zip格式的压缩形式放入虚拟主指向的目录(也可以lamp下载)
给laravel 的两个文件夹 storage vendor
以777权限
sudo chmod -R 777 storage vendor(一定要给权限)
配置好虚拟主机
vim /etc/httpd/conf/httpd.conf
在文件最后加上
<VirtualHost *:80>
ServerName www.nvyuanshiguang.club
DocumentRoot /var/www/html/jixiaoqin/public #laravel项目的根目录
<Directory "/var/www/html/jixiaoqin/public">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
service httpd restart
最后一步脸上数据库就done了