Michael Smith

Registered
Sep 10, 2016
4
1
3
United Kingdom
cPanel Access Level
Root Administrator
Hi all,

Im sorry if this is a very silly question.

When users use PHP on our server if they include a file or require a file like so

require_once 'vendor/autoload.php';

it will error out saying.

PHP Warning: require_once(vendor/autoload.php): failed to open stream: No such file or directory in /home/<user>/public_html/development/index.php on line 10 [15-Sep-2017 17:18:46 Europe/London] PHP Fatal error: require_once(): Failed opening required 'vendor/autoload.php' (include_path='.:/opt/cpanel/ea-php56/root/usr/share/pear') in /home/<user>/public_html/development/index.php on line 10

Although the file is there. its showing the include pather as ".:/opt/cpanel/ea-php56/root/usr/share/pear" rather than their user area.

This seems odd.. How can i make this to their user area ?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

You can define the absolute path instead of the relative path to address that issue. EX:

Code:
/home/username/public_html/development/vendor/autoload.php
Let us know if that helps.

Thank you.
 

abelardolg

Member
May 16, 2020
6
0
1
Madrid
cPanel Access Level
Website Owner
I would like the following scenery:

3 Symfony apps which store the content of their public directory into the "public_html".

I created 3 dirs: dev, pre and pro.

Then, I run the following command:
- ln -s ~/dev/public public_html
(the same for pre and for pro).

But it doesn't work. A 404 error is showed.

How to solve it?