PHP/Pear Problem - help please!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • russell.hunter@sashait.co.uk

    PHP/Pear Problem - help please!

    I have pear installed on my web server. The problem is, I can't seem
    to get it working!

    Whenever I try to call one of the installed packages, for example:

    require_once "DB.php";

    I get the following error:

    Warning: main(): open_basedir restriction in effect.
    File(/usr/share/pear/DB.php) is not within the allowed path(s):
    (/var/www/vhosts/xentek.co.uk/httpdocs:/tmp) in
    /var/www/vhosts/xentek.co.uk/httpdocs/wda2-winestore/index.php on line
    19

    The value of my phpInfo(); says the following for open_basedir:

    open_basedir | /var/www/vhosts/xentek.co.uk/httpdocs:/tmp | no value

    This problem seems to be mentioned often when I did a search, but I
    could not find any solution!

    Please help if possible, I've spent too long already trying to get this
    working!

    Regards,
    --
    RH

  • NC

    #2
    Re: PHP/Pear Problem - help please!

    russell.hunter@ sashait.co.uk wrote:[color=blue]
    >
    > Whenever I try to call one of the installed packages, for example:
    >
    > require_once "DB.php";
    >
    > I get the following error:
    >
    > Warning: main(): open_basedir restriction in effect.
    > File(/usr/share/pear/DB.php) is not within the allowed path(s):
    > (/var/www/vhosts/xentek.co.uk/httpdocs:/tmp) in
    > /var/www/vhosts/xentek.co.uk/httpdocs/wda2-winestore/index.php
    > on line 19[/color]

    You need to modify your php.ini. Right now, it has a line that says:

    open_basedir = /var/www/vhosts/xentek.co.uk/httpdocs:/tmp

    Modify it to the following:

    open_basedir =
    /var/www/vhosts/xentek.co.uk/httpdocs:/tmp:/usr/share/pear

    Alternatively, you can simply disable safe mode...

    Cheers,
    NC

    Comment

    • russell.hunter@sashait.co.uk

      #3
      Re: PHP/Pear Problem - help please!

      Thanks, I did as you suggested and set open_basedir to what you said
      above in my php.ini file. Unfortunately, it seems to being overridden
      at some stage?

      You can view my phpInfo for the server by visiting:


      You can see the values for open_basedir are now:
      open_basedir /var/www/vhosts/xentek.co.uk/httpdocs:/tmp /var/www/vhosts/xentek.co.uk/httpdocs:/tmp:/usr/share/pear

      Any ideas why my php.ini is being overridden?

      Comment

      • NC

        #4
        Re: PHP/Pear Problem - help please!

        russell.hunter@ sashait.co.uk wrote:[color=blue]
        > I did as you suggested and set open_basedir to what you said
        > above in my php.ini file. Unfortunately, it seems to being overridden
        > at some stage?
        >
        > You can view my phpInfo for the server by visiting:
        > http://www.xentek.co.uk/wda2-winestore/
        >
        > You can see the values for open_basedir are now:
        > open_basedir
        > /var/www/vhosts/xentek.co.uk/httpdocs:/tmp
        > /var/www/vhosts/xentek.co.uk/httpdocs:/tmp:/usr/share/pear
        >
        > Any ideas why my php.ini is being overridden?[/color]

        First, try restarting Apache if you didn't already.

        If that doesn't help, check your httpd.conf. It may have a line like
        this:

        php_admin_value open_basedir /var/www/vhosts/xentek.co.uk/httpdocs:/tmp

        open_basedir is a PHP_INI_SYSTEM directive, meaning that it can be set
        only from php.ini or httpd.conf.

        If this doesn't help (which is unlikely), check other .ini files parsed
        by PHP; your phpinfo() output lists them:

        /etc/php.d/domxml.ini,
        /etc/php.d/imap.ini,
        /etc/php.d/ldap.ini,
        /etc/php.d/mbstring.ini,
        /etc/php.d/mysql.ini,
        /etc/php.d/odbc.ini,
        /etc/php.d/pgsql.ini,
        /etc/php.d/snmp.ini,
        /etc/php.d/xmlrpc.ini

        Cheers,
        NC

        Comment

        • russell.hunter@sashait.co.uk

          #5
          Re: PHP/Pear Problem - help please!


          NC wrote:
          [color=blue]
          > russell.hunter@ sashait.co.uk wrote:[color=green]
          > >
          > > Any ideas why my php.ini is being overridden?[/color]
          >
          > First, try restarting Apache if you didn't already.[/color]

          Yes, I'd restarted the server.
          [color=blue]
          > If that doesn't help, check your httpd.conf. It may have a line like
          > this:
          >
          > php_admin_value open_basedir /var/www/vhosts/xentek.co.uk/httpdocs:/tmp
          >
          > open_basedir is a PHP_INI_SYSTEM directive, meaning that it can be set
          > only from php.ini or httpd.conf.[/color]

          There's no mention of open_basedir in my httpd.conf file, sadly.
          [color=blue]
          > If this doesn't help (which is unlikely), check other .ini files parsed
          > by PHP; your phpinfo() output lists them:
          >
          > /etc/php.d/domxml.ini,
          > /etc/php.d/imap.ini,
          > /etc/php.d/ldap.ini,
          > /etc/php.d/mbstring.ini,
          > /etc/php.d/mysql.ini,
          > /etc/php.d/odbc.ini,
          > /etc/php.d/pgsql.ini,
          > /etc/php.d/snmp.ini,
          > /etc/php.d/xmlrpc.ini[/color]

          Each of these files is used to enable an extension.

          So, I'm stuck on this one. Thanks for your help. I don't suppose
          there's anything else I should try?

          Kind regards,
          --
          RH

          Comment

          Working...