sudo apt-get update
sudo apt-get upgrade
step2:安装git
sudo apt-get install git
二:安装php5.4。sudo apt-get install python
sudo add-apt-repository ppa:ondrej/php5-oldstable sudo apt-get update
sudo apt-get install php5
sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php5-mysql
sudo apt-get install curl openssl php5-mcrypt php5-common php5-dev php5-cli php5-gd php5-ps
cd ~/
wget https://github.com/stefanesser/suhosin/archive/master.zip
step3:进入suhosin-master文件夹运行phpize命令:unzip master.zip
cd suhosin-master
step4:运行phpize命令后自动生成configure文件,在终端应看到如下输出:phpize
step5:运行configure文件你的用户名@你的用户名:~/suhosin-master$ phpize
Configuring for: PHP Api Version: 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220100525
step6:运行make命令./configure
step7:运行make install命令,需要root权限make
step8:设置suhosin 打开suhosin.ini在其文件最后添加一行suhosin.executor.include.whitelist = pharsudo make install
在文件最后添加一行suhosin.executor.include.whitelist = pharsudo cp suhosin.ini /etc/php5/conf.d
sudo gedit /etc/php5/conf.d/suhosin.ini
sudo a2enmod rewrite
sudo gedit /etc/apache2/sites-available/default
4:改为:这一步到你安装好laravel后再修改。DocumentRoot /var/www <Directory /var/www>
5:设置apache2.confDocumentRoot /home/www/laravel/public <Directory /home/www/laravel/public> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>
在文件的最后添加下面的内容sudo gedit /etc/apache2/apache2.conf
ServerName 127.0.0.1 DirectoryIndex index.html index.htm index.php AddDefaultCharset GB2312
sudo service apache2 restart
2:把composer移动到/usr/local/bin下cd ~/
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
解压master.zipcd /home/www/laravel wget https://github.com/laravel/laravel/archive/master.zip
解压完成后可以删除master.zip文件。unzip master.zip && cd laravel-master/ && mv * ../ && cd ..
用composer安装laravel的依赖包rm -r laravel-master && rm master.zip
八:把www目录加入到apache2所在的用户组sudo composer install
2:设置app/storage为777sudo chown -R 你的登录名:www-data /home/www
sudo chmod -R 777 /home/www/laravel/app/storage
sudo service apache2 restart
sudo gedit /etc/apache2/sites-available/default
九:如果框架附带的 .htaccess 文件在你的Apache环境中不起作用,请尝试下面这个版本:
把下面的内容写到.htaccess文件里。sudo gedit /home/www/laravel/app/config/.htaccess
Options +FollowSymLinksRewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]RewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^ index.php [L]