Jump to content
Larry Ullman's Book Forums

Path Name For Mysqli_Connect.php In Script 18.3


Recommended Posts

Hi

 

I am running XXAMP server on a Windows 7 machine.  I am trying to get the register.php working but I keep getting the error An error occurred in script 'C:\xampp5519\htdocs\mms\register.php' on line 10: require(/localhost/mms/mysqli_connect.php): failed to open stream: No such file or directory.

 

This is the path I have set up in config.inc.php

define ('MYSQLI', '/localhost/mms/mysqli_connect.php');

 

I presume I have wrongly specified the path name, but it looks right to me.  

 

The files are stored at c:\xxamp5519\htdocs\mms\mysqli_connect.php

 

I am hoping it is something obvious but I just can't see it.  Can anyone help.

 

Thanks in advance.

Kind regards,

Santilal

   

Link to comment
Share on other sites

Hello,

 

I have finally through trial and error got this code to work.  You see I misunderstood that the absolute path had to be specified starting from the drive.  So when I changed the code to:

 

define ('MYSQLI', 'c:\\xampp5519\htdocs\mms\mysqli_connect.php');

 

it ran fine.

 

This is fine for testing as I am developing and testing my code on an xampp server running on my laptop, so I know what the absolute path is.  But what happens when I make my website live on a server hosted by a webhost.  How will I find out what the absolute path is?  Is this something webhosts make freely available?

 

Thanks.

Santilal

Link to comment
Share on other sites

 Share

×
×
  • Create New...