[SOLVED] "can't establish a connection to the server...
[SOLVED] "can't establish a connection to the server...
Hi,
trying to do a local install so I can develop my site then install and import my mysql data later. However, I can see the frontend but cannot get through to the admin end of things.
As it seems to be to do with connecting to localhost, I'm assuming it is something to do with a setting in the config file.
Can anyone help me solve this one?
Thanks
trying to do a local install so I can develop my site then install and import my mysql data later. However, I can see the frontend but cannot get through to the admin end of things.
As it seems to be to do with connecting to localhost, I'm assuming it is something to do with a setting in the config file.
Can anyone help me solve this one?
Thanks
Last edited by mr_nabo on Thu 30. Aug 2007, 20:01, edited 2 times in total.
If you can see the frontend... then it must be connecting to localhost just fine... that's the local "friendly name" for IP address 127.0.0.1 that your Apache is serving up the page to. (ie. same as http://127.0.0.1/phpwcms_directory/index.php)
What exactly DOES happen when you go to "login.php" instead of "index.php" ? Does login just return to the same screen? Do you get an error message? Does it not paint the login screen (or can't it find it)?
What exactly DOES happen when you go to "login.php" instead of "index.php" ? Does login just return to the same screen? Do you get an error message? Does it not paint the login screen (or can't it find it)?
Thanks for getting back to me Dexxus.
When I go to the login.php page, I see the usual form asking for login data. I enter the correct username and password I created during my installation and then I can't go any further. I receive the message:
"Unable to connect
Firefox can't establish a connection to the server at localhost.
* The site could be temporarily unavailable or too busy. Try again in a few moments.
* If you are unable to load any pages, check your computer's network
connection... etc."
Any ideas?
When I go to the login.php page, I see the usual form asking for login data. I enter the correct username and password I created during my installation and then I can't go any further. I receive the message:
"Unable to connect
Firefox can't establish a connection to the server at localhost.
* The site could be temporarily unavailable or too busy. Try again in a few moments.
* If you are unable to load any pages, check your computer's network
connection... etc."
Any ideas?
Okay... that looks like how Firefox generically responds to not being able to connect. Check to make sure your MySQL installation's path/username/pass are correct by browsing to the path that you have set in "conf.inc.php" and then entering your MySQL username/password. See if it lets you log into MySQL (NOT using your phpWCMS user/pass).
I assume it's not to do with the MySQL settings because I can see the frontend fine.
However, the paths may be wrong... If you have time, take a look at the below please. I installed phpwcms into a folder in the root (called 'phpwcms_1.3.3'). Do I need to change the DOC_ROOT path?:
However, the paths may be wrong... If you have time, take a look at the below please. I installed phpwcms into a folder in the root (called 'phpwcms_1.3.3'). Do I need to change the DOC_ROOT path?:
Code: Select all
// paths
$phpwcms['DOC_ROOT'] = $_SERVER['DOCUMENT_ROOT'];// real DOC_ROOT seems to be: '/Applications/MAMP/htdocs//inc'
$phpwcms['root'] = 'phpwcms_1.3.3'; //default: ''
$phpwcms['file_path'] = 'filearchive'; //default: 'filearchive'
$phpwcms['templates'] = 'template'; //default: 'template'
$phpwcms['content_path'] = 'content'; //default: 'content'
$phpwcms['cimage_path'] = 'images'; //default: 'images'
$phpwcms['ftp_path'] = 'upload'; //default: 'upload'
Your problem is that phpWCMS has to open the MySQL database when you try to login to the CMS in order to authorize you and set up for any content you might add/change. Even though the path to your database is right...it looks like the MySQL username or password for your databse is not allowing access. If those other paths were wrong...you probably wouldn't see your frontend or at the least you'd have errors. Did you log in to MySQL like I asked (using the values you have stored in your "conf.inc.php")? You should confirm this! 

No problem (although i gotta run in a minute) I mean these:
If all fails, see if you can edit your PHP installation's "php.ini" file and set error_reporting line to temporarily show all errors.
SORRY to bug out on ya... but I can't continue right now...Keep chugging... somebody else will pick up where I left you hanging.
Code: Select all
// database values
$phpwcms['db_host'] = 'localhost';
$phpwcms['db_user'] = '';
$phpwcms['db_pass'] = '';
$phpwcms['db_table'] = '';
$phpwcms['db_prepend'] = '';
$phpwcms['db_pers'] = 1;
$phpwcms['db_charset'] = 'utf8';
$phpwcms['db_collation'] = 'utf8_general_ci';
$phpwcms['db_version'] = 0;
SORRY to bug out on ya... but I can't continue right now...Keep chugging... somebody else will pick up where I left you hanging.

Ok, a quick look at the PHP log and I think I know what's going on, just don't know what to do about it. If anyone can help me where Dexxus left off, I'd be very appreciative. Here's the common log error:
That suggests to me that I need to change the path somewhere in the config.inc.php file so that my phpwcms installation reads from the 'phpwcms_1.3.3' folder that is found in my root folder.
Anybody help me out on what I should do next?
Thanks
Code: Select all
[30-Aug-2007 02:38:32] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required '/Applications/MAMP/htdocs/include/inc_ext/Openads/Openads_function.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/phpwcms_1.3.3/include/inc_lib/default.inc.php on line 66
Anybody help me out on what I should do next?
Thanks
Not sure if I could add anything over what DeXXus suggested:
hmm... anyhow, I suppose/presume you are trying to browse your site
with this default Apache MAMP port :
http://localhost:8888
aren't you ?
Cheers,
Yves
Code: Select all
$phpwcms['db_user'] = '';
$phpwcms['db_pass'] = '';
$phpwcms['db_table'] = '';
hmm... anyhow, I suppose/presume you are trying to browse your site
with this default Apache MAMP port :
http://localhost:8888
aren't you ?
Cheers,
Yves

PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
Hi Yves,
Yes, I'm trying to access the admin end of my site at 'http://localhost:8888/phpwcms_1.3.3/login.php' and frontend at 'http://localhost:8888/phpwcms_1.3.3/index.php'.
Here are the details I have for '//database values' (password and user omitted obviously):
Don't know what to do apart from uninstall and start again...
Yes, I'm trying to access the admin end of my site at 'http://localhost:8888/phpwcms_1.3.3/login.php' and frontend at 'http://localhost:8888/phpwcms_1.3.3/index.php'.
True, changing the '//paths' value leaves the whole site unreachable.Even though the path to your database is right...it looks like the MySQL username or password for your databse is not allowing access. If those other paths were wrong...you probably wouldn't see your frontend or at the least you'd have errors.
This is the part I'm having trouble with understanding. I can't see a path in the below that I can use to then try my MySQL details with. The only path I have set has been the ['DOC_ROOT'] and ['site'] entries in config.inc.php during the installation process.Check to make sure your MySQL installation's path/username/pass are correct by browsing to the path that you have set in "conf.inc.php" and then entering your MySQL username/password. See if it lets you log into MySQL (NOT using your phpWCMS user/pass).
Here are the details I have for '//database values' (password and user omitted obviously):
Code: Select all
//database values
$phpwcms['db_host'] = 'localhost';
$phpwcms['db_user'] = 'db_user_name';
$phpwcms['db_pass'] = 'db_password';
$phpwcms['db_table'] = 'phpwcms';
$phpwcms['db_prepend'] = '';
$phpwcms['db_pers'] = 1;
$phpwcms['db_charset'] = 'utf8';
$phpwcms['db_collation'] = 'utf8_general_ci';
$phpwcms['db_version'] = 50019;
Hi again Mr Nabo,
The only thing that I can think of checking again, would be
this line in your config file:
Are set like this ?
Cheers,
Yves
The only thing that I can think of checking again, would be
this line in your config file:
Code: Select all
$phpwcms['site'] = 'http://localhost:8888/';
Cheers,
Yves

PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
Yves makes sense...since you show the presumed correct entries for $phpwcms['DOC_ROOT'] and $phpwcms['root'] in your "conf.inc.php" above. (You can always check what phpinfo is reporting for $_SERVER['DOCUMENT_ROOT'] to make sure it is picking it up correctly.)StudioZ wrote:Hi again Mr Nabo,
The only thing that I can think of checking again, would be
this line in your config file:Are set like this ?Code: Select all
$phpwcms['site'] = 'http://localhost:8888/';
Cheers,
Yves
mr_nabo wrote:[30-Aug-2007 02:38:32] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required '/Applications/MAMP/htdocs/include/inc_ext/Openads/Openads_function.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/phpwcms_1.3.3/include/inc_lib/default.inc.php on line 66
You're right (as you can see from the path differences of the error message). The code below defines the phpWCMS constants, then makes the call to require "Openads_function.php":mr_nabo wrote:That suggests to me that I need to change the path somewhere in the config.inc.php file so that my phpwcms installation reads from the 'phpwcms_1.3.3' folder that is found in my root folder.
"/include/inc_lib/default.inc.php"
Code: Select all
if(!empty($phpwcms["root"])) {
$phpwcms['DOC_ROOT'] .= '/'.$phpwcms["root"];
$phpwcms["root"] .= '/';
}
define ("PHPWCMS_ROOT", $phpwcms['DOC_ROOT']);
define ('PHPWCMS_FILES', $phpwcms["file_path"].'/');
define ('PHPWCMS_BASEPATH', '/'.$phpwcms["root"]);
define ('On', true);
define ('Off', false);
define ('PHPWCMS_USER_KEY', md5(getRemoteIP().$phpwcms['DOC_ROOT'].$phpwcms["db_pass"]));
require(PHPWCMS_ROOT.'/include/inc_ext/Openads/Openads_function.php');
$phpwcms['browser_detect'] = phpAds_getUserAgent();
Superb!
That was it. I needed the ports in the site url ($phpwcms['site'] = 'http://localhost:8888/').
Thank you both for your efforts, they are much appreciated.
All the best
That was it. I needed the ports in the site url ($phpwcms['site'] = 'http://localhost:8888/').
Thank you both for your efforts, they are much appreciated.
All the best