473,320 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Problem with require() and script under public_html

Hi,

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:

require_once("Net/IPv4.php");

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! :-)

James

Apr 27 '06 #1
2 1584
Maybe this would work...

require_once("{$_SERVER['DOCUMENT_ROOT']}/Net/IPv4.php");

ac*****@hotmail.com wrote:
Hi,

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:

require_once("Net/IPv4.php");

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! :-)

James


Apr 28 '06 #2
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! ;-)

James

Apr 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andrew Taranov | last post by:
Hi! I've got a problem attaching the Script Debugger to ASP pages under IIS6. Set up everything following IIS6 documentation: turned on ASP debug in IIS Manager; edited permissions for Machine...
6
by: blueghost73 | last post by:
We've got a couple of scripts that we routinely run on several SQL servers, and they usually run fine. But we're trying to run them on one particular server, and we're running into problems. I'm no...
4
by: none | last post by:
Below is an old count-up script that displays ok in MSIE with a bit of experimenting, but NS shows negative values that make no sense. Anyone know how to make it work ok in both? === Cut ===...
1
by: stefano | last post by:
Hi, I have a file xml (p.xml) and I use XSLT to trasform p.xml to XHTML. this is the xml file: .... <test label="x"> <itemList> <testItem oknumber="2" > .... </testItem> </itemList>
3
by: Benton | last post by:
Hi there, I'm following the instructions to use NiftyCorners, a javascript library. Following the examples, I've set up a first try. But I got a javascript error 'object was expected'. Please...
5
by: Tom | last post by:
I have a function that restricts access to a page to logged in users. When a user who isn't logged in goes to the page, it will dynamically generate a login form. I'm trying to use it in...
0
by: ipranay | last post by:
i am trying to create a ssis package with a web service task in it, which will call the web service available on our intranet, everything is fine except that the httpconnection that is to be used has...
22
by: V S Rawat | last post by:
(bringing the discussion here for php.general) I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b. http://localhost/ is E:\wamp\www\ I have put the first php script...
1
by: Maanav Jackson | last post by:
Hi I am displaying a third party webpage into a variable using curl library. When i am displaying the variable in the browser using echo command as shown below. echo $pagecopy; Browser is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.