By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,043 Members | 1,135 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,043 IT Pros & Developers. It's quick & easy.

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

P: n/a

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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
The include path reads like this:

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

Jul 17 '05 #4

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.