1

after one month of deploy my site in host and working normally. now i can't access in any page i get download index.php ?? why and how i can fix that ?

index.php

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylor@laravel.com>
 */

define('LARAVEL_START', microtime(true));

require __DIR__.'/../vendor/autoload.php';


$app = require_once __DIR__.'/../bootstrap/app.php';


$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);
Boutamente abdessamad
  • 523
  • 2
  • 10
  • 30
  • Check [this](https://stackoverflow.com/questions/18422140/apache-is-downloading-php-files-instead-of-displaying-them) Maybe some server confs were changed? – Mihir Bhende Feb 18 '19 at 21:38
  • Usually happens if php is not configured properly. You are running "php artisan serve" right? – Andrew Larsen Feb 18 '19 at 21:42
  • You webserver won't execute php, therefore fall back to offer the file for download. Thats not a PHP nor laravel issue, but a hosting issue. What webserver do you use and how is it configured to execute PHP scripts? – paskl Feb 18 '19 at 21:56
  • no i don't run the server ,because the server was working normal all time ,i will contact my support – Boutamente abdessamad Feb 18 '19 at 22:04
  • 1
    Possible duplicate of [Apache is downloading php files instead of displaying them](https://stackoverflow.com/questions/18422140/apache-is-downloading-php-files-instead-of-displaying-them) – Yassine CHABLI Feb 18 '19 at 22:31

1 Answers1

0

Check this 2 things.

  1. You have php installed on your server, php -v on the terminal
  2. The directory index for the web-server ex apache this can be on the main configuration or in a virtual host.
DirectoryIndex index.html index.php 

Vidal
  • 2,605
  • 2
  • 16
  • 32