Jump to content

How can I change the include_path in order to access PEAR packages?


Recommended Posts

Posted

Hi everyone!

 

I need to use a couple of PEAR packages for my website on heliohost, but I just can't set the include_path for my code to see these packages.

 

The PEAR packages are being installed under /home1/my_domain/php/

 

My code is in this folder: /home1/my_domain/public_html/

 

If, for example, I need to use the package Net_UserAgent_Detect

 

I have this line in my code:

require_once( "Net/UserAgent/Detect.php" );

 

and I get this error:

Fatal error: require_once() [function.require]: Failed opening required 'php/Net/UserAgent/Detect.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/missions/public_html/browser_sniffer.php on line 13

 

If I change the code to:

require_once( "../php/Net/UserAgent/Detect.php" );

 

then everything works fine.

 

The problem is that I need to use a lot of PEAR packages and some have tons of files I would need to modify the 'require_once' lines for.

 

I think I need to add "../php/" to my include_path in PHP but I haven't been able to do that.

 

I tried this:

ini_set("include_path", '../php:' . ini_get("include_path") );

 

but no luck. It seems like heliohost does not let me edit php.ini.

 

Can someone please tell me how I can add '../php/' to my include_path ?

 

I would be very grateful!

 

Thanks in advance.

Guest Geoff
Posted

Yes; I would recommend using a global PHP include file that you can make changes to all of your scripts.

Posted
Yes; I would recommend using a global PHP include file that you can make changes to all of your scripts.

 

Ok. I see.

 

Thanks a lot for your help!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...