Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

beracah.kings's avatar

deploying in shared server

im trying to deploy my laravel app on shared server , i put the files under public into public_html and rest of the files in a folder named as websitefolder.

In the index.php file under public i change

require __DIR__.'/../websitefolder/vendor/autoload.php';
$app = require_once __DIR__.'/../websitefolder/bootstrap/app.php';

I get the below error in log

 PHP Warning:  require(/home/somename/public_html/../websitefolder/bootstrap/autoload.php): failed to open stream: No such file or directory in /home/somename/public_html/index.php on line 25

 PHP Fatal error:  require(): Failed opening required '/home/somename/public_html/../websitefolder/bootstrap/autoload.php' (include_path='.:/opt/alt/php71/usr/share/pear') in /home/somename/public_html/index.php on line 25

How to publish

0 likes
3 replies
TerrePorter's avatar

So the directory structure is ?

/home/somename/public_html
/home/somename/websitefolder
beracah.kings's avatar

i figured it out. thank you terreporter.

in the .htaccess file, i missed a slash.

Please or to participate in this conversation.