Problem with require() and script under public_html

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm trying to include PEAR's Net_IPv4 module in a web PHP script I'm
coding. Using PHP v4.4.0.

Other scripts on this web server (not personal user scripts, but main
site ones) call it with:


and it works.

My script is under my public_html directory and if I use that same line
I get a "Fatal error: Call to undefined function: validateip() in
/home/james/public_html/test/srt/srt-0_3.php on line 258".

I thought that maybe PHP safe mode was on (theoretically it's not, but
since I don't own that IPv4.php file...), so I placed my own copy of
IPv4.php in my own public_html, then in the same dir as the script,
then under Net directories in each of the two previous ones, always
with the same error message.

This server's include path is set to:

include_path = ".:/usr/lib/php"

According to my interpretation of the documentation, if I use
"require_once("./IPv4.php");" and include IPv4.php in the script's same
directory it should work... what am I missing here?

Thanks for your help!  :-)


Re: Problem with require() and script under public_html

Maybe this would work...

require_once("/Net/IPv4.php"); wrote:
Quoted text here. Click to load it

Re: Problem with require() and script under public_html

Ok... that did not make it, but thanks for pitching in, Philip.

I finally found what I was doing wrong... I was supposed to call the
function as Net_IPv4::functionname() instead of using just
functionname(). I'm not sure if that is because of some config on this
server or if always has to be done that way...

If somebody is willing to enlighten me, I'll appreciate it.

But hey... it works now!   ;-)


Site Timeline