473,394 Members | 1,817 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,394 software developers and data experts.

i moved my software to a new server and now the include statements won't work at all


I wrote a PHP content management system and it worked fine on old
servers. I just moved it to a new server on Rackspace. I'm trying to
debug. At the top of the first file (index.php) I need to include a
file. The file won't be included. In the code below, $success remains
false. I've checked a million times and the file is there.

error_reporting(E_ALL);

$success = include("ppKernel/McControllerForAll.php");
if (!$success) $success = include("ppExtras/McControllerForAll.php");
if (!$success) $success = include("McControllerForAll.php");
if (!$success) $success = @include("../McControllerForAll.php");
if (!$success) $success = @include("../../McControllerForAll.php");
if (!$success) $success = @include("../../../McControllerForAll.php");
if (!$success) $success =
@include("../../../../McControllerForAll.php");

Jul 17 '05 #1
6 1375
did you print the value of $succes ? and does the first file has (and the
others) a "return" at the end ? if not, after a successfull include $success
will have value "1" which will results in failure on the checks ....
see include manual for details info.
<lk******@geocities.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...

I wrote a PHP content management system and it worked fine on old
servers. I just moved it to a new server on Rackspace. I'm trying to
debug. At the top of the first file (index.php) I need to include a
file. The file won't be included. In the code below, $success remains
false. I've checked a million times and the file is there.

error_reporting(E_ALL);

$success = include("ppKernel/McControllerForAll.php");
if (!$success) $success = include("ppExtras/McControllerForAll.php");
if (!$success) $success = include("McControllerForAll.php");
if (!$success) $success = @include("../McControllerForAll.php");
if (!$success) $success = @include("../../McControllerForAll.php");
if (!$success) $success = @include("../../../McControllerForAll.php");
if (!$success) $success =
@include("../../../../McControllerForAll.php");

Jul 17 '05 #2
lk******@geocities.com wrote :
I wrote a PHP content management system and it worked fine on old
servers. I just moved it to a new server on Rackspace. I'm trying to
debug. At the top of the first file (index.php) I need to include a
file. The file won't be included. In the code below, $success remains
false. I've checked a million times and the file is there.

error_reporting(E_ALL);

$success = include("ppKernel/McControllerForAll.php");
if (!$success) $success = include("ppExtras/McControllerForAll.php");
if (!$success) $success = include("McControllerForAll.php");
if (!$success) $success = @include("../McControllerForAll.php");
if (!$success) $success = @include("../../McControllerForAll.php");
if (!$success) $success = @include("../../../McControllerForAll.php");
if (!$success) $success =
@include("../../../../McControllerForAll.php");


do you know what the include_path is set to in your php config
settings? (php.ini or equivilent) are you able to modify that setting,
or at least check it?

--
talk to the teacher now and then about something other than the subject

Jul 17 '05 #3
The include path reads like this:

include_path .:/usr/share/pear .:/usr/share/pear

Jul 17 '05 #4
lk******@geocities.com wrote:
I wrote a PHP content management system and it worked fine on old
servers. I just moved it to a new server on Rackspace. I'm trying to
debug. At the top of the first file (index.php) I need to include a
file. The file won't be included. In the code below, $success remains
false. I've checked a million times and the file is there.
include_once ("db_fns.php");
error_reporting(E_ALL);

$success = include("ppKernel/McControllerForAll.php");
if (!$success) $success = include("ppExtras/McControllerForAll.php");
if (!$success) $success = include("McControllerForAll.php");
if (!$success) $success = @include("../McControllerForAll.php");
if (!$success) $success = @include("../../McControllerForAll.php");
if (!$success) $success = @include("../../../McControllerForAll.php");
if (!$success) $success =
@include("../../../../McControllerForAll.php");

I am not positive but I think you have to fully qualify your
path name. Try setting up an ini_set statement. For example my
ISP requires the following:

ini_set('include_path','/usr/local/lib/php');

You should then be able to use your first include statement.
HTH

Jerry
Jul 17 '05 #5
NC
lk******@geocities.com wrote:

I wrote a PHP content management system and it worked fine
on old servers. I just moved it to a new server on Rackspace.
I'm trying to debug. At the top of the first file (index.php)
I need to include a file. The file won't be included. In the
code below, $success remains false. I've checked a million
times and the file is there.

error_reporting(E_ALL);
$success = include("ppKernel/McControllerForAll.php");
if (!$success) $success = include("ppExtras/McControllerForAll.php");


Most likely, this is a permissions problem. The user on behalf
of which Apache is running must be allowed to read the file
being included. When this is not the case, an include() can't
take place.

On shared servers, these permission are ususally set up
automatically during account activation. At Rackspace,
where you get a dedicated server, you are the administrator
and must make sure the correct privileges are set.

Cheers,
NC

Jul 17 '05 #6
Okay, apparently it turned out that the file I was trying to include
had a parse error in it. Not sure how. The buffer didn't allow the
error message to reach my screen. I don't have ssh on this machine so I
had no easy way to check the PHP error log.

I did ob_off_flush(), or whatever that command is, but it didn't help.
The text didn't reach my screen.

Jul 17 '05 #7

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

Similar topics

15
by: wEEdpEckEr | last post by:
Hi, here's the deal: I have a config.php file in which I have set a few var's, to use in the whole site. E.g.: $db_host = "localhost"; Then I also have a class, which is supposed to...
2
by: Brad Tilley | last post by:
I've written and tested a *very basic* socket server that I'll have to deploy soon... sooner than I'd like as much of the functionality that I want to include hasn't been implemented or even tested...
28
by: puzzlecracker | last post by:
Large scale C++ software design, by John Lakos - people any good recommendations to this book?
5
by: hntgzr | last post by:
I am trying to include a function in a .php file on a different server from the main .php files. I am using: include_path=http://www.anotherserver.com/foldername;...
10
by: JDS | last post by:
Hi all. I don't know if this is possible, and if it is, whether it needs to be done within Apache configuration or PHP configuration, but here goes: I am migrating my web server to another...
74
by: John Wells | last post by:
Yes, I know you've seen the above subject before, so please be gentle with the flamethrowers. I'm preparing to enter a discussion with management at my company regarding going forward as either...
12
by: Steve Pope | last post by:
Compiling the following works on my system: file main.cpp: #include <iostream> namespace space { int foo; }
1
by: mark4asp | last post by:
I moved a page to another web-site and now it's broke! I had 5 pages in their own web-site. These pages have now been moved to another web-site. Everything is fine except that one of the pages,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.