PHP-FPM include_path

Discussion in 'Installation/Configuration' started by bax, Aug 15, 2014.

  1. bax

    bax Member

    Hi!

    Where would I set / change PHPs include_path?

    I'm using NGINX with PHP-FPM on a debian wheezy system.

    I installed php-awl. My scripts didn't find it in the beginning, I had to add
    Code:
    include_path = ".:/usr/share/php:/usr/share/awl/inc"
    in the php.ini-settings of my site.
    The php-scripts on the site then worked. However, if I run the php scripts from shell as sudo user, the following errors occur:

    Code:
    PHP Fatal error:  require_once(): Failed opening required 'XMLElement.php' (include_path='.:/usr/share/php:/usr/share/pear:/var/www/clients/client0/web3/push/') in …
    I then also added the include_path to my php.ini but that didn't change anything.

    Where else are these include_paths set by ISPConfig?
    What am I missing?
    Is it correct to just add it in the php-ini-settings of the site? Would it be sufficient to just add (append) "/usr/share/awl/inc" or would it have to be all paths?

    Thank you!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess yu missed to set the include path in the php.ini file of your Linux distribution that is used by shell scripts. On Debian and Ubuntiú, this file is /etc/php5/cli/php.ini. The issue is not related to ispconfig as ispconfig does not configure php shell scripts at all.
     
  3. bax

    bax Member

    I totally missed that, yes. Thank you!
    But the include_path in this file is commented out (;). Could it then be this?
    Why does it default to include_path='.:/usr/share/php:/usr/share/pear:/var/www/clients/client0/web3/push/ then?

    Sorry if my questions are too stupid.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The apth /var/www/clients/client0/web3/push is not set by ispcnfig, so either you have set this in a file that gets included in this php.ini or it is maybe a auto prepend file that sets it or something like that. Did you check this on the commandline and not by a php script of the website?
     
  5. bax

    bax Member

    Sorry, you're right. This is set by the script.
    And the /usr/share/pear?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    /usr/share/pear is the default from php, I guess thats set at compile time. A commented out include_path in php.ini means that php shall use its defaults and not that there is no include path at all :)
     
  7. bax

    bax Member

    Thank you!
     

Share This Page