Santilal Posted June 14, 2016 Share Posted June 14, 2016 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 More sharing options...
Santilal Posted June 15, 2016 Author Share Posted June 15, 2016 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 More sharing options...
Larry Posted June 16, 2016 Share Posted June 16, 2016 Kudos for figuring it out and thanks for sharing the solution. Yes, your webhost can help you know what your absolute path should be. Link to comment Share on other sites More sharing options...
Santilal Posted June 16, 2016 Author Share Posted June 16, 2016 Thank you for that advice. Cheers Santilal Link to comment Share on other sites More sharing options...
Recommended Posts