Page 1 of 1
Problem mit DOCUMENT_ROOT
Posted: Sat Mar 29, 2014 12:03 pm
by bekon
Wegen eines unerklärlichen Fehlers in einem PHP-Sript habe ich mich entschlossen, RapidPHP zu testen.
Und bin gleich gestolpert.
Seit langem läuft meine Page local(Xampp) sowie Online.
Auch RapidPHP kann ich alle Seiten anschauen - bis zum LOGIN (MyPHPLogin)
Hier stimmt plötzlich $_SERVER['Document_root'] nicht mehr!
Statt [DOCUMENT_ROOT] =>
G:/xampp/htdocs/CGS
bekomme ich nur
[DOCUMENT_ROOT] =>
G:/xampp/htdocs
zurück und damit ist ende und ich kann Scripts innerhalb des LOGIN-Systems nicht mehr testen.
Es kommen natürlich Fehlermeldungen wie diese :
Warning: include(G:/xampp/htdocs/PHP/mysql.inc) [function.include]: failed to open stream: No such file or directory in G:\xampp\htdocs\CGS\PHP\Login\login.php on line 6
Hinter htdocs fehlt CGS.
Auch bis zum LOGIN wird $_SERVER['Document_root'] ständig benutzt und funktioniert.
Wie kann es dann passieren, das $_SERVER['Document_root'] verschiedene Werte zurück gibt?
Hier die ersten Zeilen des LOGINS:
Code: Select all
$Server_Name=$_SERVER["SERVER_NAME"];
$Root="/PHP/Login/";
include($_SERVER["DOCUMENT_ROOT"]."/PHP/mysql.inc");
include_once($_SERVER["DOCUMENT_ROOT"]."/PHP/Login/lang/lang_DE.php");
include_once($_SERVER["DOCUMENT_ROOT"]."/PHP/log.php");
.
.
.
Danke für schnelle Problemlösung

Re: Problem mit DOCUMENT_ROOT
Posted: Tue Apr 01, 2014 11:08 am
by Aivars
Do I understand it correctly - your script displays correctly in browser via
http://localhost/PHP/login/login.php but not in RapidPHP preview?
Check under Options -> Preferences -> PHP Settings that you use the same xampp instance, then check Options -> Preferences -> Preview -> Web Server Settings, and then check Options -> Preferences -> Preview -> Mappings and make sure that everything seems correct.
Re: Problem mit DOCUMENT_ROOT
Posted: Wed Apr 02, 2014 10:12 am
by bekon
Thank you aivars
everything is working fine online and offline (with xampp).
And I can see all Pages correctly in RP-Preview except the LOGIN-Page (and of course the following pages)
Have a look at
http://www.chariots.de/intern/intern.php.
So I think, Preferences are OK.
The correct $_SERVER['Document_root']=G:/xampp
/htdocs/CGS , but on the LOGIN-Page it is
$_SERVER['Document_root']=G:/xampp
/htdocs
Why $_SERVER['Document_root'] is changed in the LOGIN-Page?
Error:
Warning: include(G:/xampp/htdocs/PHP/mysql.inc) [function.include]: failed to open stream: No such file or directory in G:\xampp\htdocs\CGS\PHP\Login\login.php on line 5
Re: Problem mit DOCUMENT_ROOT
Posted: Wed Apr 02, 2014 1:59 pm
by Aivars
Can you call phpinfo() in login.php and check if there's something strange going on?
Re: Problem mit DOCUMENT_ROOT
Posted: Wed Apr 02, 2014 3:49 pm
by bekon
In Firefox with Xampp phpinfo() in Login.php says:
$_SERVER['Document_root']=G:/xampp/htdocs/CGS
In RP Preview i miss /CGS in $_SERVER['Document_root']=G:/xampp/htdocs
Re: Problem mit DOCUMENT_ROOT
Posted: Tue Apr 08, 2014 12:19 pm
by bekon
No idea?
I have 15 starts left for testing.
And I will buy RP, when this problem is solved.
Re: Problem mit DOCUMENT_ROOT
Posted: Wed Apr 09, 2014 4:08 pm
by Aivars
Did you verify these settings?
Options -> Preferences -> PHP Settings
Options -> Preferences -> Preview -> Web Server Settings
Options -> Preferences -> Preview -> Mappings
Maybe you have added something different from xampp settings.
If you're not sure whether it's correct or not, you can send me a screenshot.
Re: Problem mit DOCUMENT_ROOT
Posted: Wed Apr 09, 2014 10:20 pm
by bekon
Aivars wrote:Did you verify these settings?
Options -> Preferences -> PHP Settings :
Path to PHP.exe= G:\xampp\php\php.exe
Options -> Preferences -> Preview -> Web Server Settings:
Port89---G:\xampp\htdocs\CGS---G:\xampp\php\php-cgi.exe
Options -> Preferences -> Preview -> Mappings:
Local= G:\xampp\htdocs\ ---Webserver= http://localhost/
I've tried all posible Mappings
Re: Problem mit DOCUMENT_ROOT
Posted: Fri Apr 11, 2014 10:45 am
by Aivars
First of all this
Mappings: Local= G:\xampp\htdocs\ ---Webserver=
http://localhost/
should be
Mappings: Local= G:\xampp\htdocs\CGS ---Webserver=
http://localhost/
And make sure "Use folder mapping when displaying preview" is checked.
When you change the settings, restart RapidPHP, then preview login.php. Preview it in Internet Explorer instead of Chrome, right click the preview -> Properties. Is the address (URL) correct?
Re: Problem mit DOCUMENT_ROOT
Posted: Fri Apr 11, 2014 3:14 pm
by bekon
If I change settings and debug starting with index.php, i get the Xampp-Page (Localhost/xampp).
May be there is an problem with my xampp-settings.
I'm using virtual hosts and my 'normal' Url offline is: LOC.cgs.de instead of
http://WWW.cgs.de.
Code: Select all
<VirtualHost *:80>
ServerAdmin bernd@kondermann.net
DocumentRoot "G:/xampp/htdocs/CGS"
ServerName loc.cgs.de
ServerAlias loc.cgs.de
<Directory "G:/xampp/htdocs/CGS">
Order allow,deny
Allow from all
DirectoryIndex index.html index.htm index.php
</Directory>
</VirtualHost>
I will check it soon.