Home >PHP Framework >Laravel >Install Laravel on Mac computer

Install Laravel on Mac computer

步履不停
步履不停Original
2019-06-25 14:51:183928browse

Install Laravel on Mac computer

  1. Create project through composer
    1.1 Run the command in the terminal to install laravel
    composer create-project --prefer-dist laravle/laravel slrApp
    1.2 Configure the virtual domain name
    1) Modify the hosts file in the terminal
    1.1 sudo su Obtain permissions
    1.2 vim /etc/hosts vim to modify the hosts file. After entering, go to the last line and press the i key to enter the editor.
    1.3 127.0.0.1 slrApp.net Enter what you want to use Domain name, press esc after modification to exit editing, then enter :wq to save
    1.4 vim /private/etc/apache2/extra/httpd-vhosts.conf vim edit httpd-vhosts.conf file

    <VirtualHost *:80>
    DocumentRoot "/Users/zhouhongliang/Site/slrApp/public"
    ServerName slrApp.net
    ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"
    CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common
    </VirtualHost>

    Fill in the final path and domain name and change the path and domain name to your own
    1.5 Restart apache
    sudo apachectl restart
    1.6 An error is reported when accessing the domain name and the log file cannot be opened because permissions need to be added to the storage and bootstrap/cache in the project
    1) In the terminal, enter the project root directory
    2) After enteringsudo chmod -R 777 storage
    3) Enter the bootstrap file again
    4) Execute sudo chmod -R 777 cache/
    and then access the Laravel project successfully.

For more Laravel related technical articles, please visit the Laravel Tutorial column to learn!

The above is the detailed content of Install Laravel on Mac computer. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn