LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-18-2003, 06:20 AM   #1
toadeny
LQ Newbie
 
Registered: Sep 2003
Location: Wellington, New Zealand
Distribution: Fedora Core 3
Posts: 17

Rep: Reputation: 0
php parsing some includes. others are not.


just after i get flippin the l.a.m.p sorted it does this.

why is it that if i include a plain file with plain html that it works fine but if i include the db connection script i have made it dosent want to know.

i get this error, yes. the file is uploaded. is there a place to change were the default like include goes to?

im stumped on this one.

heres the error, yes the file db.php is uploaded to my server...

Warning: Failed opening 'shop/db.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/index2.php on line 1

thanks .
 
Old 09-18-2003, 06:46 AM   #2
nephilim
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (server), Kubuntu (desktop)
Posts: 248

Rep: Reputation: 30
could you post the part of your code that generates errors from index2.php?
 
Old 09-18-2003, 07:09 AM   #3
glj
Member
 
Registered: Jul 2001
Location: London
Distribution: RH 9
Posts: 151

Rep: Reputation: 30
Try inputting './shop/db.php' instead of just 'shop/db.php' to the include command

i.e. include('./shop/db.php');
instead of include('shop/db.php');

glj
 
Old 09-18-2003, 07:24 AM   #4
toadeny
LQ Newbie
 
Registered: Sep 2003
Location: Wellington, New Zealand
Distribution: Fedora Core 3
Posts: 17

Original Poster
Rep: Reputation: 0
i tried "./" and "/"

i belive this is a php setup issue or version issue,
i have apache 2, php 4.2.2 and mysql something. the standard install with redhat 9.

this same code works fine on my actual web host. just not locally on my linux server.... weird, thanks for your help.

index2.php --->

Code:
 <? include ("shop/db.php"); ?>

Last edited by toadeny; 09-18-2003 at 07:27 AM.
 
Old 09-18-2003, 09:50 AM   #5
glj
Member
 
Registered: Jul 2001
Location: London
Distribution: RH 9
Posts: 151

Rep: Reputation: 30
What directory is index2.php in?
If it is /var/www/html/index2.php, then db.php should be /var/www/html/shop/db.php
PHP will only look in the the directories specified in the include path found in php.ini, which in your case has . (i.e. the current directory) and /usr/share/pear. Make sure the filenames are correct, remembering they are case sensitive, and check the permissions of the file and the directory it is in.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing URL in PHP benrose111488 Programming 6 10-12-2005 12:12 PM
PHP not parsing code... libertyboy Linux - Software 3 08-24-2004 11:09 AM
PHP includes lawadm1 Linux - Software 1 08-21-2004 04:20 PM
php not parsing chens_83 Linux - General 9 02-19-2003 04:53 AM
PHP -> parsing urls DJFau Programming 14 08-07-2001 01:33 PM


All times are GMT -5. The time now is 05:32 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration