jon2396 Posted May 10, 2009 Share Posted May 10, 2009 I am setting up a previously built Joomla site on my local host. I have successfully imported the database to my localhost. I have the site files in my localhost in localhost\xampp\htdocs\test and I have made the following changes to the configuration.php file in folder 'test': var $dbtype = 'mysql'; var $host = 'localhost'; var $user = 'root'; var $db = 'ukactive1'; var $log_path = '/var/localhost/htdocs/logs'; var $tmp_path = '/var/localhost/htdocs/tmp'; The site accesses the database and much of the functionality in the site appears to be working, but here is my problem... There are several custom modules on the site all of which previously worked perfectly. Now I get the following message on the site in my browser: Warning: include(../../configuration.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\test\modules\mod_Searched_Companies\clsSearchedCompany.php on line 2 and also: Warning: include() [function.include]: Failed opening '../../configuration.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\test\modules\mod_Searched_Companies\clsSearchedCompany.php on line 2 Line 2 in clsSearchedCompany.php contains the following: include "../../configuration.php"; If anyone can help I would greatly appreciate it. Many thanks Link to comment https://forums.phpfreaks.com/topic/157632-warning-includeconfigurationphp-functioninclude-failed-to-open/ Share on other sites More sharing options...
chronister Posted May 10, 2009 Share Posted May 10, 2009 Anytime I use an include or require, I use the following syntax.... include($_SERVER['DOCUMENT_ROOT'].'/path/to/file/include.php'); Nate Link to comment https://forums.phpfreaks.com/topic/157632-warning-includeconfigurationphp-functioninclude-failed-to-open/#findComment-831237 Share on other sites More sharing options...
jon2396 Posted May 10, 2009 Author Share Posted May 10, 2009 Thanks for your post, any chance you could give me a bit more detail specific to my problem here? I am not particularly familiar with php, would just like to get my site working on my localhost. Jon Link to comment https://forums.phpfreaks.com/topic/157632-warning-includeconfigurationphp-functioninclude-failed-to-open/#findComment-831243 Share on other sites More sharing options...
chronister Posted May 11, 2009 Share Posted May 11, 2009 The warning is saying that the path definition is wrong. failed to open stream: No such file or directory in...... It is looking in the wrong place for the file. Something is different in the paths between your localhost and your old server. Change include "../../configuration.php"; to include($_SERVER['DOCUMENT_ROOT'].'/PATH/TO/configuration.php'); Change the PATH/TO part, to the actual path from your root directory to that file. Hope that helps. Link to comment https://forums.phpfreaks.com/topic/157632-warning-includeconfigurationphp-functioninclude-failed-to-open/#findComment-831252 Share on other sites More sharing options...
jon2396 Posted May 11, 2009 Author Share Posted May 11, 2009 Well I'm not certain which configuration.php file it is trying to call but I have tried your method assuming it is the joomla configuration file, but I now have an error: Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\test\modules\mod_Quick_Search\clsQuickSearch.php on line 8 Line 8 is function getAllActivities() { $strSQL = "select * from activities order by Activity asc"; Any ideas? Link to comment https://forums.phpfreaks.com/topic/157632-warning-includeconfigurationphp-functioninclude-failed-to-open/#findComment-831262 Share on other sites More sharing options...
chronister Posted May 11, 2009 Share Posted May 11, 2009 The config file it is looking for is 2 directories above your file... C:\xampp\htdocs\test\configuration.php The problem is very possibly in line 7. What is that one? Link to comment https://forums.phpfreaks.com/topic/157632-warning-includeconfigurationphp-functioninclude-failed-to-open/#findComment-831277 Share on other sites More sharing options...
jon2396 Posted May 11, 2009 Author Share Posted May 11, 2009 Here are lines 1 to 13. 1 <?php 2 include "/../../configuration.php;"; 3 class quicksearch 4 { 5 6 function getAllActivities() 7 { 8 $strSQL = "select * from activities order by Activity asc"; 9 //echo $strSQL; 10 $result = mysql_query($strSQL); 11 if(!$result) 12 { 13 return 0; Link to comment https://forums.phpfreaks.com/topic/157632-warning-includeconfigurationphp-functioninclude-failed-to-open/#findComment-831286 Share on other sites More sharing options...
chronister Posted May 11, 2009 Share Posted May 11, 2009 Line 2 needs to be include "/../../configuration.php"; instead of include "/../../configuration.php;"; ... there is an extra semi-colon inside the ". Try that and see if it helps. Nate Link to comment https://forums.phpfreaks.com/topic/157632-warning-includeconfigurationphp-functioninclude-failed-to-open/#findComment-831739 Share on other sites More sharing options...
jon2396 Posted May 12, 2009 Author Share Posted May 12, 2009 That was a mistake in copying the code, in my original post that ; wasn't there. So no, sadly it doesn't make a difference. Any other ideas? Link to comment https://forums.phpfreaks.com/topic/157632-warning-includeconfigurationphp-functioninclude-failed-to-open/#findComment-832210 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.