When I'm doing a post request using AJAX, I'm getting this error:
PHP Parse error: syntax error, unexpected '/*' (T_STRING), expecting ')' in /home/laravel/public_html/public/index.php on line 47
PHP Fatal error: require(): Failed opening required '/home/user/public_html/vendor/ClassLoader.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public_html/vendor/autoload.php on line 6
The index.php it's referring to is as following:
<?php
require __DIR__.'/../../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../../laravel/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);
I have no idea why this is happening.
This only happens in safari and a few other browsers. Doesn't happen on chrome.
The inspect element looks like this:
Please help guys. Thanks
Edit: Folder structure:
home/user/laravel -> All my laravel files
home/user/laravel/public_html/public -> my public folder
When I do composer install
, it gives me this error:
Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI
Composer could not find a composer.json file in /usr/bin
For some reason, it's looking for composer.json file in /usr/bin. The composer.json file is in the current directory in which I am cd'd to.