0

I am trying to moving my Laravel 5.1 app from one Ubuntu 14.04 server to another. I have updated the installed composer, database info, the app key, cleared cache and the sites-enabled points to the public directory. However instead of app up and running all I see is the text of the index.php file. Any thoughts?

techwestcoastsfosea
  • 686
  • 3
  • 10
  • 21

3 Answers3

1

If you're just seeing the code of the index.php file, then I suppose your php is not installed properly. That is why php code of index.php file is not being executed and it is shown as plain text only.

Try running this command on terminal

php -v
Sahil
  • 428
  • 2
  • 7
  • 15
  • It is installed. Please see below:PHP 5.5.9-1ubuntu4.20 (cli) (built: Oct 3 2016 13:00:37) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies – techwestcoastsfosea Oct 26 '16 at 03:50
  • I installed all the PHP and relevant dependencies on a new Ubuntu 14.04 EC2 server. It connects to my RDS instance with a drupal installation and I can build content. .htaccess works fine too. The path is /var/www/html/drupal Then i created another directory parallel to drupal called laravel /var/www/html/laravel. I copied over my app to the laravel director. Also updated the .env with my database credentials and created a new Application key. Cleared cache. Ran composer update. But see a white screen. If in the route home (/) I add echo 'Welcome to my site'; it works. Thoughts? – techwestcoastsfosea Oct 26 '16 at 06:17
  • To clarify further if I go to the /var/www/html/laravel via browser i.e. http://myipdadress/laravel/ all i see is my directory listing – techwestcoastsfosea Oct 26 '16 at 06:33
  • @JotiBasi go to yourip/laravel/public or much better choice would be that you run `php artisan serve` in the root of your laravel project – Sahil Oct 26 '16 at 14:27
0

Actually turns out it was the apache configuration issue. The site below helped. I ended up creating aliases so that I am no longer shown the directory listings.

http://mackhankins.com/blog/laravel-5-virtual-host-for-an-apache-subdirectory

techwestcoastsfosea
  • 686
  • 3
  • 10
  • 21
0

If you are using apache it may refer to this question:

Apache shows php code instead of executing

If you are using nginx, you may now config the nginx correctly, and it server *.php just as static file .

Community
  • 1
  • 1
KIDJourney
  • 1,200
  • 1
  • 9
  • 22