简体   繁体   中英

Laravel on Cpanel shared hosting

I have gone through most of the articles online and none of the solution worked.

I have my project installed in /home/projectname directory and created a symlink /home/projectname/public to /username/public_html

Storage directory is linked as well.

So far I have tried following

1) Set file permission using this answer

2) I have checked that necessary extensions are installed using php -m command.

3) Also tried to move files from /home/projctname/public directory to /home/public_html and change the necessary files like server.php , index.php and AppServiceProvider.php

None of the above worked.

Strange thing is if I have index.html in public folder that file and content is accessed fine but index.php file is not executed.

I tried echo out some string from /home/projectname/public/index.php but it seems like that index.php is not being executed.

What else can I try to fix my problem?

Thank you

not sure if this will help, but two quick things to check. Not sure what OS you are running, but if something like Ubuntu with Apache2, you could check

sudo nano /etc/apache2/mods-enabled/dir.conf

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

Making sure index.php is first. and then do you have a virtual hosts file?

<VirtualHost *:80>
    ServerName yourdomain.com

    ServerAdmin webmaster@localhost
    DocumentRoot /home/your-project/public

    <Directory /home/your-project>
        AllowOverride All
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM