Home> PHP Framework> Laravel> body text

Install Laravel on Mac computer

步履不停
Release: 2019-06-25 19:43:19
Original
3778 people have browsed it

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.1sudo suObtain permissions
    1.2vim /etc/hostsvim to modify the hosts file. After entering, go to the last line and press theikey to enter the editor.
    1.3127.0.0.1slrApp.netEnter what you want to use Domain name, pressescafter modification to exit editing, then enter:wqto save
    1.4vim /private/etc/apache2/extra/httpd-vhosts.confvim edit httpd-vhosts.conf file

     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 
    Copy after login

    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) Executesudo chmod -R 777 cache/
    and then access the Laravel project successfully.

For more Laravel related technical articles, please visit theLaravel Tutorialcolumn 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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!