First time in Ubuntu configuration Apache+php+mysql Environment Run laravel5.1

Source: Internet
Author: User
Tags phpinfo

This article is a record of the problems encounteredInstallation SectionRecommend everyone to see http://www.mr-wu.cn/aliyun-ecs-ubuntu/

Here excerpt the installation section:

install MySQL

sudo apt-get install Mysql-server

Installing Apache

sudo apt-get install apache2

Installing the PHP 5 environment

sudo apt-get install LIBAPACHE2-MOD-PHP5

sudo a2enmod php5

Restart Apache Service

sudo service apache2 restart

Next verify the PHP environment, edit a phpinfo.php file fangdao/var/www/html (This is the Ubuntu 14.04 environment)

sudo vim/var/www/html/phpinfo.php

combining PHP with MySQL

sudo apt-get install Php5-mysql

Then install composer This everybody own Baidu to find the next tutorial

During composer installation of Laravel, because this server only has 512M of memory ... Cause the following error

Exception ' Errorexception ' with Message ' Proc_open (): Fork Failed-cannot Allocate memory ' in Phar

Here's how to fix it:

execute the following command to open swap:

if=/dev/zero of=/varcount=1024/sbin/mkswap/var/swap.1/sbin/swapon/var /SWAP.1

Go back to/var/www/html/directory to perform composer update;

Because apache2 points to a Web site root directory that is/var/www/html/, you want to modify the configuration file 000-default.conf

vim/etc/apache2/sites-enabled/000-default. conf

Point the Web site root directory to/var/www/html/public/

And then modify/etc/apache2/apache2.conf's here.

<directory/var/www/>         Options Indexes followsymlinks         allowoverride None           Require All granted</Directory>

Change the None allowoverride none to all. Save Restart Apache2

At this point the URL, if a 500 error occurs. That is because the storage directory does not have 777 permissions.

到/var/www/html/目录 执行

chmod -R 777 Storage

Finish the call!


First time in Ubuntu configuration Apache+php+mysql Environment Run laravel5.1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.