Ask a Question related to PHP Development, Design and Development.
-
Brian Lovely #1
Newbie: Trouble w/ O'Reilly example
I am trying to work with example code from "Programming PHP" chapter
8. The example is the "Business Listing" application. All the files
are in the same directory. When I open "admin.php" in my browser from
[url]http://127.0.0.1/~myusername/admin.php[/url], I get the following message:
Fatal error: Failed opening required 'db_login.php'
(include_path='.:/usr/lib/php') in /Users/brianl/Sites/admin.php on
line 4
I even tried putting the db_login.php in /usr/lib/php, but no luck. I
thought that PHP started looking for included files in the current
directory, anyway.
Here's the beginning of "admin.php" :
<html>
<head>
<?php
require_once('db_login.inc');
?>
It seems pretty straightforward...I don't get it.
Can anyone help?
Thanks,
Brian
Brian Lovely Guest
-
actionscript newbie trouble
hi there, i'm trying to trigger a colour change in an movie clip as i drag it over another on, sounds simple but its driving me mad, any help would... -
Newbie Trouble with Settings
I recently upgraded to Flash MX and am having trouble setting it so that when you are drawing a rectangle or oval or anything actually you can see... -
Newbie Having Trouble with Tutorial Book
I found a new book for starting out to learn PHP/MySQL Web App programming. I've begun exercises toward that end. So far I've opened MySQL--I'm... -
Newbie having trouble with SpecTcl, TkListbox and TkScrollbar
I'm trying to learn Tk and SpecTcl. I created this layout with the SpecTcl tool and then hand modified the commands in it. Everything works... -
Newbie: Having trouble compiling Apache 2.0.46 on Solaris 8
I am sure that I don't have my environment setup properly so your help is greatly appreciated. How should I configure my environment? What... -
Jedi121 #2
Re: Newbie: Trouble w/ O'Reilly example
"Brian Lovely" a écrit le 20/11/2003 :
[..]> Fatal error: Failed opening required 'db_login.php'
> (include_path='.:/usr/lib/php') in /Users/brianl/Sites/admin.php on
> line 4Choose between db_login.inc or db_login.php...>
> <html>
> <head>
> <?php
> require_once('db_login.inc');
>
> ?>
>
> It seems pretty straightforward...I don't get it.
Jedi121 Guest
-
Eric Kincl #3
Re: Newbie: Trouble w/ O'Reilly example
Brian Lovely wrote:
Hey,> I am trying to work with example code from "Programming PHP" chapter
> 8. The example is the "Business Listing" application. All the files
> are in the same directory. When I open "admin.php" in my browser from
> [url]http://127.0.0.1/~myusername/admin.php[/url], I get the following message:
>
> Fatal error: Failed opening required 'db_login.php'
> (include_path='.:/usr/lib/php') in /Users/brianl/Sites/admin.php on
> line 4
>
> I even tried putting the db_login.php in /usr/lib/php, but no luck. I
> thought that PHP started looking for included files in the current
> directory, anyway.
>
> Here's the beginning of "admin.php" :
>
> <html>
> <head>
> <?php
> require_once('db_login.inc');
>
> ?>
>
> It seems pretty straightforward...I don't get it.
>
> Can anyone help?
> Thanks,
> Brian
For it to be parsed as PHP it needs to have that PHP extension. Try naming
it "db_login.inc.php". Also, sticking it in /usr/lib/php won't do anything
from what I can tell. Stick it in the same directory as "admin.php" (which
should be under your webroot somewhere or in user public_html) If you move
it anywhere separate from "admin.php", you would want a folder somewhere
called "includes" and all your .inc.php files in there.
-Eric Kincl
Eric Kincl Guest
-
Eric Kincl #4
Re: Newbie: Trouble w/ O'Reilly example
Jedi121 wrote:
Listen to him, ignore what I just said... I didn't pay close attention.> "Brian Lovely" a écrit le 20/11/2003 :> [..]>> Fatal error: Failed opening required 'db_login.php'
>> (include_path='.:/usr/lib/php') in /Users/brianl/Sites/admin.php on
>> line 4>>>
>> <html>
>> <head>
>> <?php
>> require_once('db_login.inc');
>>
>> ?>
>>
>> It seems pretty straightforward...I don't get it.
> Choose between db_login.inc or db_login.php...
(Does PHP parse .inc files?!?)
-Eric Kincl
Eric Kincl Guest
-
Jedi121 #5
Re: Newbie: Trouble w/ O'Reilly example
"Eric Kincl" a écrit le 20/11/2003 :
Wrong! Not necessary in an include statement.> Hey,
> For it to be parsed as PHP it needs to have that PHP extension. Try naming
> it "db_login.inc.php".
Jedi121 Guest
-
Eric Kincl #6
Re: Newbie: Trouble w/ O'Reilly example
Jedi121 wrote:
Thanks for correcting me... I never knew that before. I thought I had tried> "Eric Kincl" a écrit le 20/11/2003 :>>> Hey,
>> For it to be parsed as PHP it needs to have that PHP extension. Try
>> naming it "db_login.inc.php".
> Wrong! Not necessary in an include statement.
it without the .php extension and it not working... apparently I didn't.
Now I don't have to stick the stupid .php there! Thanks!
-Eric Kincl
Eric Kincl Guest
-
Brian Lovely #7
Re: Newbie: Trouble w/ O'Reilly example
> > Choose between db_login.inc or db_login.php...
***SORRY***>
> Listen to him, ignore what I just said... I didn't pay close attention.
> (Does PHP parse .inc files?!?)
>
>
> -Eric Kincl
The .inc suffix is the result of my trying different things to make
this work. Initially, it was all .php While cutting and pasting to
create my original post I was not careful enough and got bits of two
different versions.
To reiterate, the require_once() argument was db_login.php, and the
file I was moving around in order to get it recognized was indeed
db_login.php
I apologize for the confusion.
This is driving me nuts, BTW, I don't understand why PHP doesn't just
find the darn file.
--Brian
Brian Lovely Guest



Reply With Quote

