3

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

Mike Ross
  • 2,942
  • 5
  • 49
  • 101
  • It hards to identify your error, better please copy or screenshot the error message put here. Anyway please make sure it has public/.htaccess? – Kakada NEANG Sep 16 '19 at 06:57
  • @KakadaNeang it has .htaccess in project public directory and I have made no changes there – Mike Ross Sep 16 '19 at 07:05
  • So make sure the content of .htaccess file the same as your local file, because sometime cpanel has been modified it. Other things check your web server, does it able to read the public/index.php file? – Kakada NEANG Sep 16 '19 at 07:17
  • @KakadaNeang that's the problem it can read `index.html` in the public folder but not `index.php` – Mike Ross Sep 16 '19 at 07:19

1 Answers1

0

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>
Jimmy
  • 242
  • 1
  • 3
  • 9