Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Php include issues

Discussion in 'EasyApache' started by Michael Smith, Sep 15, 2017.

  1. Michael Smith

    Michael Smith Registered

    Joined:
    Sep 10, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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 ?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page