php-general Digest 30 Nov 2012 03:33:51 -0000 Issue 8053
Topics (messages 319763 through 319779):
Re: PDO question
319763 by: Jim Giner
319764 by: admin.buskirkgraphics.com
319765 by: Jim Giner
319766 by: admin.buskirkgraphics.com
319767 by: Jim Giner
319772 by: Jim Lucas
319777 by: Fatih P.
319779 by: admin.buskirkgraphics.com
PDO mysql Connection issue
319768 by: admin.buskirkgraphics.com
319769 by: Mike Mackintosh
319770 by: admin.buskirkgraphics.com
319771 by: David Robley
seg fault with pecl ps extension
319773 by: Ray
319774 by: Adam Richardson
319775 by: Ray
319776 by: Adam Richardson
building an improved service log
319778 by: rene7705
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On 11/28/2012 3:58 PM, ad...@buskirkgraphics.com wrote:
Guys,
I am not quiet sure what is happening but every time i try to connect to a
remote host it refers back to localhost.
$pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password');
ERROR: Access denied for user 'user'@'localhost' (using password: YES) in
/var/www/html/text.php
Any clue as to WHY it keeps referring back to localhost when i clearly set the
host parameter to another server.
I checked the /etc/hosts records to see if there was a referral for that domain
back to it's self there is NOT.
Just a WAG from a guy who's never tried to do this.
Could the localhost in question actually be the server you are failing
to connect to, and not your client machine? You are sure about your
uid/pswd? dbname?
--- End Message ---
--- Begin Message ---
>On November 28, 2012 at 4:11 PM Jim Giner <jim.gi...@albanyhandball.com> wrote:
> On 11/28/2012 3:58 PM, ad...@buskirkgraphics.com wrote:
> >
> > Guys,
> > I am not quiet sure what is happening but every time i try to connect to a
> > remote host it refers back to localhost.
> >
> > $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password');
> >
> > ERROR: Access denied for user 'user'@'localhost' (using password: YES) in
> > /var/www/html/text.php
> >
> > Any clue as to WHY it keeps referring back to localhost when i clearly set
> > the
> > host parameter to another server.
> > I checked the /etc/hosts records to see if there was a referral for that
> > domain
> > back to it's self there is NOT.
> >
> Just a WAG from a guy who's never tried to do this.
>
> Could the localhost in question actually be the server you are failing
> to connect to, and not your client machine? You are sure about your
> uid/pswd? dbname?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
I actually do not allow the user in the connection string to connect locally
which makes me think it is not accepting the host parameter and defaulting to
the localhost.
I would expect this if connecting localhost but the IP is not the local host IP.
My question is WHY is it changing the host parameter?
--- End Message ---
--- Begin Message ---
On 11/28/2012 4:18 PM, ad...@buskirkgraphics.com wrote:
On November 28, 2012 at 4:11 PM Jim Giner <jim.gi...@albanyhandball.com> wrote:
On 11/28/2012 3:58 PM, ad...@buskirkgraphics.com wrote:
Guys,
I am not quiet sure what is happening but every time i try to connect to a
remote host it refers back to localhost.
$pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password');
ERROR: Access denied for user 'user'@'localhost' (using password: YES) in
/var/www/html/text.php
Any clue as to WHY it keeps referring back to localhost when i clearly set
the
host parameter to another server.
I checked the /etc/hosts records to see if there was a referral for that
domain
back to it's self there is NOT.
Just a WAG from a guy who's never tried to do this.
Could the localhost in question actually be the server you are failing
to connect to, and not your client machine? You are sure about your
uid/pswd? dbname?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I actually do not allow the user in the connection string to connect locally
which makes me think it is not accepting the host parameter and defaulting to
the localhost.
I would expect this if connecting localhost but the IP is not the local host IP.
My question is WHY is it changing the host parameter?
Like I said just a WAG, but are you sure about my other questions? My
point is perhaps the error message itself is a little confusing and the
response from the sql server is using the term localhost to refer to
itself, but that message is getting passed back to your server and then
to you, causing perhaps(?) some confusion.
--- End Message ---
--- Begin Message ---
> On November 28, 2012 at 4:11 PM Jim Giner <jim.gi...@albanyhandball.com>
> wrote:
> On 11/28/2012 3:58 PM, ad...@buskirkgraphics.com wrote:
> >
> > Guys,
> > I am not quiet sure what is happening but every time i try to connect to a
> > remote host it refers back to localhost.
> >
> > $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password');
> >
> > ERROR: Access denied for user 'user'@'localhost' (using password: YES) in
> > /var/www/html/text.php
> >
> > Any clue as to WHY it keeps referring back to localhost when i clearly set
> > the
> > host parameter to another server.
> > I checked the /etc/hosts records to see if there was a referral for that
> > domain
> > back to it's self there is NOT.
> >
> Just a WAG from a guy who's never tried to do this.
>
> Could the localhost in question actually be the server you are failing
> to connect to, and not your client machine? You are sure about your
> uid/pswd? dbname?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
In reading your question again, I get what you are saying. Let me explain.
It is not actually saying 'localhost' it is saying 'server1.mydomain.com' of the
server I am connecting from.
not the server2.mydomain.com.
I have ensured the path is correct, PING, NSLOOKUP from the server trying to
make the connection.
It changes the domain
--- End Message ---
--- Begin Message ---
On 11/28/2012 4:22 PM, ad...@buskirkgraphics.com wrote:
On November 28, 2012 at 4:11 PM Jim Giner <jim.gi...@albanyhandball.com>
wrote:
On 11/28/2012 3:58 PM, ad...@buskirkgraphics.com wrote:
Guys,
I am not quiet sure what is happening but every time i try to connect to a
remote host it refers back to localhost.
$pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password');
ERROR: Access denied for user 'user'@'localhost' (using password: YES) in
/var/www/html/text.php
Any clue as to WHY it keeps referring back to localhost when i clearly set
the
host parameter to another server.
I checked the /etc/hosts records to see if there was a referral for that
domain
back to it's self there is NOT.
Just a WAG from a guy who's never tried to do this.
Could the localhost in question actually be the server you are failing
to connect to, and not your client machine? You are sure about your
uid/pswd? dbname?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
In reading your question again, I get what you are saying. Let me explain.
It is not actually saying 'localhost' it is saying 'server1.mydomain.com' of the
server I am connecting from.
not the server2.mydomain.com.
I have ensured the path is correct, PING, NSLOOKUP from the server trying to
make the connection.
It changes the domain
would have been nice if you had specified the message exactly the first
time.
--- End Message ---
--- Begin Message ---
On 11/28/2012 12:58 PM, ad...@buskirkgraphics.com wrote:
Guys,
I am not quiet sure what is happening but every time i try to connect to a
remote host it refers back to localhost.
$pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password');
ERROR: Access denied for user 'user'@'localhost' (using password: YES) in
/var/www/html/text.php
Any clue as to WHY it keeps referring back to localhost when i clearly set the
host parameter to another server.
I checked the /etc/hosts records to see if there was a referral for that domain
back to it's self there is NOT.
There is a warning on the following page that talks about a possible
issue with connections. Might give it a look.
http://www.php.net/manual/en/ref.pdo-mysql.connection.php
--
Jim Lucas
http://www.cmsws.com/
http://www.cmsws.com/examples/
--- End Message ---
--- Begin Message ---
On Wed, Nov 28, 2012 at 9:22 PM, Jim Lucas <li...@cmsws.com> wrote:
> On 11/28/2012 12:58 PM, ad...@buskirkgraphics.com wrote:
>
>>
>> Guys,
>> I am not quiet sure what is happening but every time i try to connect to a
>> remote host it refers back to localhost.
>>
>> $pdo = new PDO('mysql:host=171.16.23.44;**dbname=test',
>> 'user','password');
>>
>> ERROR: Access denied for user 'user'@'localhost' (using password: YES) in
>> /var/www/html/text.php
>>
>> Any clue as to WHY it keeps referring back to localhost when i clearly
>> set the
>> host parameter to another server.
>> I checked the /etc/hosts records to see if there was a referral for that
>> domain
>> back to it's self there is NOT.
>>
>>
> There is a warning on the following page that talks about a possible issue
> with connections. Might give it a look.
>
> http://www.php.net/manual/en/**ref.pdo-mysql.connection.php<http://www.php.net/manual/en/ref.pdo-mysql.connection.php>
>
> --
> Jim Lucas
>
> http://www.cmsws.com/
> http://www.cmsws.com/examples/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
specify a user from your IP ( not the server IP: 171.16.23.44 ) and try
again.. If u dont have static IP, set host parameter for user: % means any
host. and connect.
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Jim Lucas [mailto:li...@cmsws.com]
> Sent: Wednesday, November 28, 2012 9:23 PM
> To: ad...@buskirkgraphics.com
> Cc: php-gene...@lists.php.net
> Subject: Re: [PHP] PDO question
>
> On 11/28/2012 12:58 PM, ad...@buskirkgraphics.com wrote:
> >
> > Guys,
> > I am not quiet sure what is happening but every time i try to connect
> > to a remote host it refers back to localhost.
> >
> > $pdo = new PDO('mysql:host=171.16.23.44;dbname=test',
> > 'user','password');
> >
> > ERROR: Access denied for user 'user'@'localhost' (using password:
> YES)
> > in /var/www/html/text.php
> >
> > Any clue as to WHY it keeps referring back to localhost when i
> clearly
> > set the host parameter to another server.
> > I checked the /etc/hosts records to see if there was a referral for
> > that domain back to it's self there is NOT.
> >
>
> There is a warning on the following page that talks about a possible
> issue with connections. Might give it a look.
>
> http://www.php.net/manual/en/ref.pdo-mysql.connection.php
>
> --
> Jim Lucas
>
> http://www.cmsws.com/
> http://www.cmsws.com/examples/
Thank you issue resolved for some reason it was passing the credentials with
the fully qualified domain name and NOT the IP and the permission failed to
match.
Not sure why it is suddenly passing the fully qualified domain name now but as
long and this works I really don’t care thanks.
--- End Message ---
--- Begin Message ---
I am having a PDO mysql connection issue I cant explain.
On server server1.mydomain.com
I have a test script
<?php
$pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password');
?>
171.16.23.44 is by an A record called server2.mydoamin.com they are 2 different
servers.
This script returns an error:
ERROR: Access denied for user 'user'@'server1.mydomain.com' (using password:
YES)
I find this ODD because that is not the server i am connecting TO but FROM.
Why would the PDO connection be referring back to its own localhost instead of
the intended domain.
I have tried this by fully qualified domain name, same thing.
I have ensured the route does exist on the connecting server.
I have ensured there is no local reference to the domain name/IP back to its
self.
I log into 171.16.23.44 and there is NO record of the failed attempt.
I validate the user has remote access rights.
I validate there is not a firewall rule blocking the host/port/you name it.
I telnet from the server to the destination via port 3306 it connects.
BTW (171.16.23.44) IS FAKE I AM USING THE IP AS AN EXAMPLE HERE.
Any clue as to WHY the host parameter is not setting or is it setting and
something else is wrong?
--- End Message ---
--- Begin Message ---
On Wednesday, November 28, 2012 at 4:50 PM, ad...@buskirkgraphics.com wrote:
> I am having a PDO mysql connection issue I cant explain.
>
> On server server1.mydomain.com (http://server1.mydomain.com)
> I have a test script
> <?php
> $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password');
> ?>
> 171.16.23.44 is by an A record called server2.mydoamin.com
> (http://server2.mydoamin.com) they are 2 different
> servers.
> This script returns an error:
> ERROR: Access denied for user 'user'@'server1.mydomain.com
> (http://server1.mydomain.com)' (using password:
> YES)
>
> I find this ODD because that is not the server i am connecting TO but FROM.
> Why would the PDO connection be referring back to its own localhost instead of
> the intended domain.
> I have tried this by fully qualified domain name, same thing.
> I have ensured the route does exist on the connecting server.
> I have ensured there is no local reference to the domain name/IP back to its
> self.
>
> I log into 171.16.23.44 and there is NO record of the failed attempt.
> I validate the user has remote access rights.
> I validate there is not a firewall rule blocking the host/port/you name it.
> I telnet from the server to the destination via port 3306 it connects.
>
> BTW (171.16.23.44) IS FAKE I AM USING THE IP AS AN EXAMPLE HERE.
>
> Any clue as to WHY the host parameter is not setting or is it setting and
> something else is wrong?
>
>
Have you tried running FLUSH HOSTS on the MySQL server?
Also, i would try to disable DNS within MYSQL by starting with
--skip-name-resolve
(http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_skip-name-resolve);
--
Mike Mackintosh
PHP 5.3 ZCE
--- End Message ---
--- Begin Message ---
> On Wednesday, November 28, 2012 at 4:50 PM, ad...@buskirkgraphics.com wrote:
>> I am having a PDO mysql connection issue I cant explain.
>>
>> On server server1.mydomain.com (http://server1.mydomain.com)
>> I have a test script
>> <?php
>> $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password');
>> ?>
>> 171.16.23.44 is by an A record called server2.mydoamin.com
>> (http://server2.mydoamin.com) they are 2 different
>> servers.
>> This script returns an error:
>> ERROR: Access denied for user 'user'@'server1.mydomain.com
>> (http://server1.mydomain.com)' (using password:
>> YES)
>>
>> I find this ODD because that is not the server i am connecting TO but FROM.
>> Why would the PDO connection be referring back to its own localhost instead
>> of
>> the intended domain.
>> I have tried this by fully qualified domain name, same thing.
>> I have ensured the route does exist on the connecting server.
>> I have ensured there is no local reference to the domain name/IP back to its
>> self.
>>
>> I log into 171.16.23.44 and there is NO record of the failed attempt.
>> I validate the user has remote access rights.
>> I validate there is not a firewall rule blocking the host/port/you name it.
>> I telnet from the server to the destination via port 3306 it connects.
>>
>> BTW (171.16.23.44) IS FAKE I AM USING THE IP AS AN EXAMPLE HERE.
>>
>> Any clue as to WHY the host parameter is not setting or is it setting and
>> something else is wrong?
>
>
> Have you tried running FLUSH HOSTS on the MySQL server?
>
> Also, i would try to disable DNS within MYSQL by starting with
> --skip-name-resolve
> (http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_skip-name-resolve);
>
> --
> Mike Mackintosh
> PHP 5.3 ZCE
>
I have tried the options listed same results.
--- End Message ---
--- Begin Message ---
"ad...@buskirkgraphics.com" wrote:
> I am having a PDO mysql connection issue I cant explain.
>
> On server server1.mydomain.com
> I have a test script
> <?php
> $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password');
> ?>
> 171.16.23.44 is by an A record called server2.mydoamin.com they are 2
> different servers.
> This script returns an error:
> ERROR: Access denied for user 'user'@'server1.mydomain.com' (using
> password: YES)
>
> I find this ODD because that is not the server i am connecting TO but
> FROM. Why would the PDO connection be referring back to its own localhost
> instead of the intended domain.
> I have tried this by fully qualified domain name, same thing.
> I have ensured the route does exist on the connecting server.
> I have ensured there is no local reference to the domain name/IP back to
> its self.
>
> I log into 171.16.23.44 and there is NO record of the failed attempt.
> I validate the user has remote access rights.
> I validate there is not a firewall rule blocking the host/port/you name
> it. I telnet from the server to the destination via port 3306 it connects.
>
> BTW (171.16.23.44) IS FAKE I AM USING THE IP AS AN EXAMPLE HERE.
>
> Any clue as to WHY the host parameter is not setting or is it setting and
> something else is wrong?
You are attempting a connection by u...@server1.mydomain.com
This request is made to the mysql server on host server2.mydomain.com which
responds with the error that access is denied for the user named 'user' on
host server1.mydomain.com
The most likely problem is that on server2.mydomain.com you do not have
mysql privileges for u...@server1.mydomain.com
--
Cheers
David Robley
People in the passing lane that don't pass will be shot.
--- End Message ---
--- Begin Message ---
Hello,
I'm not positive if this is the right list, or if other info is required.
If this is the wrong list, please recomend a better one. If other info is
desired, just ask.
I am having some problems with the PECL PS (postscript) extension. For some
commands, everything works properly, but when the code tries to deal with
fonts, it seg faults and core dumps. In my code, the problem appears to be
caused by the ps_setfont command.
I have some code that uses it that used to work, but no longer does. I have
confirmed the same behaviour with the example code that ships with the
extension, glyphlist.php for a specific example. I have un-installed and
reinstalled the php5-ps (64 bit) package through the package manager to no
effect.
sample code and system info follows sig.
any assistance appreciated,
Ray
system is Kubuntu 12.10 64bit, kernel version 3.5.0-18, php 5.4.6-1ubuntu1.1
according to php -v
my sample code:
if two marked lines are left in, seg faults, otherwise works
<?php
$file="pstest.ps";
$fonts_dir='./fonts/';
$font_size=30;
$dr2=50;
$psdoc = ps_new();
ps_set_parameter($psdoc, 'SearchPath', $fonts_dir);
if (!ps_open_file($psdoc, $file))
{
print "Cannot open PostScript file $file \n";
exit;
}
ps_set_info ($psdoc, 'Orientation' , 'Portrait');
ps_begin_page ($psdoc, 596, 842);
$psfont = ps_findfont($psdoc, "ArialMT", "");
echo "<br>$psfont<br>";
ps_setfont($psdoc, $psfont, $font_size);//works if these two lines
ps_show_xy($psdoc, 'Hello World', 30, 400);//are commented out,
ps_setcolor ($psdoc , 'both' , 'rgb', 1, 0, 0, 0);
ps_arc ($psdoc, 30, 230, $dr2, 0, 360);
ps_stroke($psdoc);
ps_end_page($psdoc);
ps_delete($psdoc);
?>
--- End Message ---
--- Begin Message ---
On Wed, Nov 28, 2012 at 10:50 PM, Ray <r...@stilltech.net> wrote:
> Hello,
> I'm not positive if this is the right list, or if other info is required.
> If this is the wrong list, please recomend a better one. If other info is
> desired, just ask.
>
> I am having some problems with the PECL PS (postscript) extension. For some
> commands, everything works properly, but when the code tries to deal with
> fonts, it seg faults and core dumps. In my code, the problem appears to be
> caused by the ps_setfont command.
> I have some code that uses it that used to work, but no longer does. I have
> confirmed the same behaviour with the example code that ships with the
> extension, glyphlist.php for a specific example. I have un-installed and
> reinstalled the php5-ps (64 bit) package through the package manager to no
> effect.
>
Hi Ray,
Does this issue coincide with an upgrade to PHP 5.4, and if so, which
version of PHP were you running before?
You could try to email the maintainer listed, Uwe Steinmann <
u...@steinmann.cx> or <ste...@php.net>, but it looks like it's been a while
since anyone has touched that code.
If this is because of backwards incompatible changes in PHP (e.g.,
http://www.php.net/manual/en/migration54.incompatible.php,
http://php.net/manual/en/migration53.incompatible.php), you could try to
avoid the PHP bindings Uwe developed and merely use PHP to call a C program
that directly deals with his project pslib:
http://pslib.sourceforge.net/
Sorry for the trouble,
Adam
--
Nephtali: A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com
--- End Message ---
--- Begin Message ---
On November 29, 2012 12:00:44 AM Adam Richardson wrote:
> On Wed, Nov 28, 2012 at 10:50 PM, Ray <r...@stilltech.net> wrote:
> > Hello,
> > I'm not positive if this is the right list, or if other info is required.
> > If this is the wrong list, please recomend a better one. If other info is
> > desired, just ask.
> >
> > I am having some problems with the PECL PS (postscript) extension. For
> > some
> > commands, everything works properly, but when the code tries to deal with
> > fonts, it seg faults and core dumps. In my code, the problem appears to be
> > caused by the ps_setfont command.
> > I have some code that uses it that used to work, but no longer does. I
> > have
> > confirmed the same behaviour with the example code that ships with the
> > extension, glyphlist.php for a specific example. I have un-installed and
> > reinstalled the php5-ps (64 bit) package through the package manager to no
> > effect.
>
> Hi Ray,
>
> Does this issue coincide with an upgrade to PHP 5.4, and if so, which
> version of PHP were you running before?
>
> You could try to email the maintainer listed, Uwe Steinmann <
> u...@steinmann.cx> or <ste...@php.net>, but it looks like it's been a while
> since anyone has touched that code.
>
> If this is because of backwards incompatible changes in PHP (e.g.,
> http://www.php.net/manual/en/migration54.incompatible.php,
> http://php.net/manual/en/migration53.incompatible.php), you could try to
> avoid the PHP bindings Uwe developed and merely use PHP to call a C program
> that directly deals with his project pslib:
> http://pslib.sourceforge.net/
>
> Sorry for the trouble,
>
> Adam
>
> --
> Nephtali: A simple, flexible, fast, and security-focused PHP framework
> http://nephtaliproject.com
Adam,
Don't apologize. Thanks for the reply.
It certainly could be due to an upgrade. I wrote my code a while ago, then let
it sit. A few days ago I tried to use it again. I first had to deal with a
change in the way call by reference worked in php. (I had to delete the '&'
from some function calls.) Did that correspond to the 5.3 -> 5.4 upgrade?
I will look at the links you provided.
Thanks again.
Ray
--- End Message ---
--- Begin Message ---
On Thu, Nov 29, 2012 at 12:18 AM, Ray <r...@stilltech.net> wrote:
> ...I first had to deal with a
> change in the way call by reference worked in php. (I had to delete the '&'
> from some function calls.) Did that correspond to the 5.3 -> 5.4 upgrade?
>
Yep, 5.4 removed call-time pass-by-reference:
http://www.php.net/manual/en/language.references.pass.php
Adam
--
Nephtali: A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com
--- End Message ---
--- Begin Message ---
Hi folks..
I've got several requirements that I'd like to roll into one software component;
- log page views and any errors that page view may generate
- log javascript events (browser user-interaction events, but also
errors on the server during ajax operations)
- log status messages during 'cron' jobs
- gather data on shared hosting and then transfer that data on regular
intervals to a home server (because shared hosting won't allow scripts
to run longer than 30 seconds, and I need to do potentially long
running calculations (statistics) on the gathered data)
I'm wondering how to do this efficiently.
I've figured out the fields I need to store, but I'm unsure whether or
not to use a single table or multiple tables.
Single tables are easier to sync from shared hosting to my home
server, but multiple tables might be faster during the calculations
and detail lookups.
Ideally I would like to log all info for all my sites and their
homeserver testing grounds into one database, but that means that the
home server will be generating data in the same tables as the data
collected from shared hosting, meaning I can't just copy over the data
with all of it's auto_increment id fields as they were on the shared
hosting.
Please help me find a graceful solution for what I want to do here..
--- End Message ---