$_SERVER Question

Status
Not open for further replies.

FootballG

New Member
Messages
17
Reaction score
0
Points
0
cPanel Username: hendrick

I'm not sure if this has to do with the PHP version I have (the second level), but I've been having some issues with the $_SERVER function.

The script I have originally worked when I first set it up. Around the time of the PHP changes, this feature quit working. So I'm not sure if the error is caused by the PHP version I have, or if it is something totally different.

Here is the exact error:

Warning: db_driver::require_once(/home/hendrick/public_html/$_SERVER['DOCUMENT_ROOT'] . "/forum//sources/sql/mysql_queries.php) [function.db-driver-require-once]: failed to open stream:

As you can see, the path isn't correct due to the $_SERVER['DOCUMENT_ROOT'] isn't replaced by the server.

Thanks for the help.
 

Russ

<b>Retired *****</b>
Messages
3,168
Reaction score
2
Points
38
No, it's caused because the MySQL server is down and it can't connect to it. Be patient and the upgrade will be done soon.
 

FootballG

New Member
Messages
17
Reaction score
0
Points
0
This issue has been occurring well before the SQL went down. It's been occurring since the time of the PHP change.


And this is a PHP issue, not a mySQL one.

Thanks for the quick reply though.
 
Last edited:

aneotoena

New Member
Messages
798
Reaction score
0
Points
0
also as far as I can see $_SERVER is a variable not a function in that script, it has to be defined somewhere else. If you are using a cms or forum check your constants file.
 
Last edited:

FootballG

New Member
Messages
17
Reaction score
0
Points
0
What I've read about it is $_SERVER['DOCUMENT_ROOT']; is a variable that defined by the host. x10 used to have this set, before the PHP change. I'm wondering if there are plans to re-add the function. Going through, modifying my whole forum would be an extreme pain... some of the coding I'm unfamiliar with.
 
Last edited:

Synkc

Active Member
Messages
1,765
Reaction score
0
Points
36
$_SERVER is a super global; a predefined variable in PHP.
The only problems I see with your script is that it is not parsing the variable correctly and that it is begin called twice; the path to the file you're requiring has already been defined, "/home/hendrick/public_html" - which is actually the equivalent of "$_SERVER['DOCUMENT_ROOT']".

By the way, what is the purpose of the script?
 
Last edited:

FootballG

New Member
Messages
17
Reaction score
0
Points
0
Invision Power Board 2.0.0 unlimited trial. (Yes, one did exist for about two weeks.)

I do plan on buying a license for their latest... I just want to make my site first, and see if it is successful at all. I've installed multiple security patches, I'm just using it to make sure my site is successful, before I spend the hundred plus on the license.
 

FootballG

New Member
Messages
17
Reaction score
0
Points
0
I really hate to bump my thread, but I'm nearly on page 10, and I need this to be added so people can register for my site.
 
Status
Not open for further replies.
Top