Re: Waiting for localhost
| From: | Richard | Date: | Wed, 01 Apr 2015 11:34:51 +0000 |
| Subject: | Re: Waiting for localhost | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-48995@lists.php.net to get a copy of this message | ||
------------ Original Message ------------
> Date: Wednesday, April 01, 2015 00:05:29 -0400
> From: Ethan Rosenberg <erosenberg@hygeiabiomedical.com>
> To: php-db@lists.php.net
>
> Richard -
>
> As we saw in the Apache list, the problem lies in PHP/MySQL
>
> To quote --
>
> "
> Date: Tuesday, March 31, 2015 02:18:13 -0400
> From: "Ethan Rosenberg, PhD" <erosenberg@hygeiabiomedical.com>
> Subject: Re: [users@httpd] Apache is Slow
>
> Some more info....
>
> Changed the host in the connect
>
> $cxn = mysqli_connect($host,$user,$password);
>
> $host="127.0.1.1";
>
> Now get an error...
>
> Warning: mysqli_connect(): (HY000/2003): Can't connect to MySQL
> server on '127.0.1.1' (111) in /var/www/HandleWeight.php on line 56
> Connect Error (2003) Can't connect to MySQL server on '127.0.1.1'
> (111)
>
> The correct IPnumber for "localhost" is "127.0.0.1". I wouldn't
> generally expect anything to answer on "127.0.1.1".
>
> Separately, I think that this likely proves that this isn't an
> apache issue. You're getting to the mysql reference in the php
> script that you're calling (from the js reference) and it's
> failing there because of the incorrect IPnumber.
>
> -->> So, apache is responding fine and it's seemingly your script
> that has problems.
> "
>
> All this having been said, I have attached HandleWeight.php
> Hopefully this will assist us in finding the error.
>
> TIA
>
> Ethan
>
I, at least, am not here to do your work for you.
> Hopefully this will assist us in finding the error.
[if you want private consulting, contact me (or likely many others
on this list), off-list for our rates.]
As has been said previously, you need to do very basic debugging.
You may need to take your script apart and test it piece by piece,
including db, includes, whatever calls/references. Check your
variables going in and out to make certain they hold the values you
expect. Check your typing to make certain that things are properly
named/referenced (e.g., that you're using the correct IPnumber for
"localhost").
If/when you have a specific issue that you are having a problem
with, feel free to post it to the list. Dumping a whole php script,
context-free, and hoping that we will do your work for you is really
not the way to get any assistance.