php-general Digest 17 Aug 2010 20:18:06 -0000 Issue 6898
Topics (messages 307492 through 307506):
Re: Including files on NFS mount slow with APC enabled
307492 by: Colin Guthrie
307493 by: Colin Guthrie
Imagick::newPseudoImage function
307494 by: NICHOLAS KLINE
Re: It's Friday (a MySQL Question) [Solution]
307495 by: tedd
mysqldump
307496 by: tedd
307497 by: Robert Cummings
307498 by: tedd
307499 by: Mari Masuda
307500 by: Robert Cummings
307501 by: David Hutto
307502 by: David Hutto
307503 by: Robert Cummings
307504 by: David Hutto
307505 by: tedd
How safe is a .htaccess file?
307506 by: tedd
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
'Twas brillig, and Mark Hunting at 17/08/10 09:08 did gyre and gimble:
> I now notice that when I replace include_once with include the open()
> call disappears. That's very nice, but why does include_once need to
> open the file, even when apc.include_once_override is enabled? Is this a
> bug?
I don't know the internals of APC but that smells like a bug to me.
Can you post the bug number here if you report one?
Cheers
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
--- End Message ---
--- Begin Message ---
'Twas brillig, and Mark Hunting at 17/08/10 09:08 did gyre and gimble:
> I now notice that when I replace include_once with include the open()
> call disappears. That's very nice, but why does include_once need to
> open the file, even when apc.include_once_override is enabled? Is this a
> bug?
I don't know the internals of APC but that smells like a bug to me.
Can you post the bug number here if you report one?
Cheers
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
--- End Message ---
--- Begin Message ---
Anyone out there using the Imagick::newPseudoImage function to create
radial gradient images? The documentation at
http://us.php.net/manual/en/function.imagick-newpseudoimage.php is
lacking.
When I try using Imagick::newPseudoImage to create a radial gradient,
this error appears in the Apache HTTP error log:
PHP Fatal error: Uncaught exception 'ImagickException' with message
'Unable to create new pseudo image: radial-gradient:#FF0000-#FFFFFF'
in /var/www/html/energy/scripts/rg.php:6\nStack trace:\n#0
/var/www/html/energy/scripts/rg.php(6): Imagick->newpseudoimage(150,
150, 'radial-gradient...')\n#1 {main}\n thrown in
/var/www/html/energy/scripts/rg.php on line 6
According to http://www.imagemagick.org/script/formats.php (search for
"radial"):
"RADIAL_GRADIENT...Gradual radial passing from one shade to
another...Returns a rendered radial gradient image using the specified
image size. Specify the desired shading as part of the filename (e.g.
radial-gradient:red-blue or radial-gradient:#F00-#00F)."
Yes, I've tried using "RADIAL_GRADIENT" instead of "radial-gradient"
and every other combination I could think of.
My PHP Script:
<?php
// Create a new imagick object.
$image = new Imagick();
// A new image with radial gradient fading from red to white,
150 by 150 pixels.
$image->newPseudoImage(150,150,'radial-gradient:#FF0000-#FFFFFF');
// Set the image format to PNG.
$image->setImageFormat('png');
// Output the image.
header("Content-Type: image/png");
echo $image;
?>
PHP: 5.1.6
OS: RHEL 5
Thanks!
--- End Message ---
--- Begin Message ---
At 5:48 PM -0400 8/13/10, tedd wrote:
Normally if I want to dump a MySQL database, I read the database via
a PHP script (i.e., list tables and fetch rows) and save the results
as a text file -- after which I download the file -- it's not a big
deal.
However while I was doing my daily read of the MySQL Manual, namely:
http://dev.mysql.com/doc/refman/5.0/en/select.html
I came across this statement:
SELECT * FROM table_reference INTO OUTFILE 'file_name'
It looked to be bit simpler/shorter than my code, so I tried it. But
it reports:
Access denied for user 'me'@'localhost' (using password: YES).
I suspect that the "access being denied" is because MySQL doesn't
have permission to create the output file. The MySQL manual reports:
1) that a file cannot be present; 2) AND MySQL must have file
privileges to create the file -- but I don't know how to set that up.
So, has anyone got this to work? If so, how did you do it? If at all
possible, please provide code (MySQL/PHP) and not command-line
statements.
The problem here was that I am on a hosted account and do not have
"Server Access" to use the "SELECT ... INTO OUTFILE" syntax.
I suspected such, but it took several exchanges on the mysql list to
prove the issue.
In short, unless you have "Server Access" , then you cannot use the
"SELECT ... INTO OUTFILE" syntax in php.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
Hi gang:
At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote:
Easiest method, from the command line on the server from which you
want to dump the database:
mysqldump -u user -p database_name > outfile.sql
That might be the easiest, but all I get is an empty file.
I've tried many different variations of the syntax using exec(), but
nothing produces any subsistent output. What am I doing wrong?
As for accessing a command line, I am still in the dark as to how to do that.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
On 10-08-17 02:08 PM, tedd wrote:
Hi gang:
At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote:
Easiest method, from the command line on the server from which you
want to dump the database:
mysqldump -u user -p database_name> outfile.sql
Command is wrong... should be:
mysqldump -u user -p password database_name > outfile.sql
That might be the easiest, but all I get is an empty file.
I've tried many different variations of the syntax using exec(), but
nothing produces any subsistent output. What am I doing wrong?
Have you checked the return code of running exec? It may be the
mysqldump program isn't in your path.
As for accessing a command line, I am still in the dark as to how to do that.
In windows you can do Start -> Run -> cmd.exe to load the command prompt
terminal. You could probably put the above mysqldump command directly
into the run prompt, but I don't know what it's default path is... but a
small tweak might be:
C:\PATH\TO\mysqlump -u user -p password database_name > C:\outfile.sql
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
At 2:17 PM -0400 8/17/10, Robert Cummings wrote:
On 10-08-17 02:08 PM, tedd wrote:
Hi gang:
At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote:
Easiest method, from the command line on the server from which you
want to dump the database:
mysqldump -u user -p database_name> outfile.sql
Command is wrong... should be:
mysqldump -u user -p password database_name > outfile.sql
I did catch that, but did not correct it in my post (considering it
was a direct quote).
-------
That might be the easiest, but all I get is an empty file.
I've tried many different variations of the syntax using exec(), but
nothing produces any subsistent output. What am I doing wrong?
Have you checked the return code of running exec? It may be the
mysqldump program isn't in your path.
No, I didn't -- however, I just did this (using the correct user,
password, and database name):
exec('mysqldump -u user -p password databaseName > outfile.txt',$a,$b);
And received back an empty array for $a and '2' for $b. I don't know
what that means.
-------
As for accessing a command line, I am still in the dark as to how to do that.
In windows you can do Start -> Run -> cmd.exe to load the command
prompt terminal. You could probably put the above mysqldump command
directly into the run prompt, but I don't know what it's default
path is... but a small tweak might be:
C:\PATH\TO\mysqlump -u user -p password database_name > C:\outfile.sql
I'm neither on Windozes nor the host. I am on a hosted account and
that may be the problem. However, I've been told that I *can* access
the command line, I am just clueless as to how to do it.
In the past I have been reluctant to try because I don't want to
screw things up. You see, it's Okay if I screw up my own system, but
someone else's, I would rather not. However, I would like to know how
to do it safely.
Thanks for your time.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
On Aug 17, 2010, at 11:40 AM, tedd wrote:
> At 2:17 PM -0400 8/17/10, Robert Cummings wrote:
>> On 10-08-17 02:08 PM, tedd wrote:
>>> Hi gang:
>>>
>>>> At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote:
>>>> Easiest method, from the command line on the server from which you
>>>> want to dump the database:
>>>>
>>>> mysqldump -u user -p database_name> outfile.sql
>>
>> Command is wrong... should be:
>>
>> mysqldump -u user -p password database_name > outfile.sql
>
>
> I did catch that, but did not correct it in my post (considering it was a
> direct quote).
>
> -------
Actually,
mysqldump -u user -p password database_name > outfile.sql
is also the incorrect command. When providing the password in the command,
there should not be a space between the "-p" and the actual password. Try
mysqldump -u user -ppassword database_name > outfile.sql
and see if that gets you anywhere.
--- End Message ---
--- Begin Message ---
On 10-08-17 02:45 PM, Mari Masuda wrote:
On Aug 17, 2010, at 11:40 AM, tedd wrote:
At 2:17 PM -0400 8/17/10, Robert Cummings wrote:
On 10-08-17 02:08 PM, tedd wrote:
Hi gang:
At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote:
Easiest method, from the command line on the server from which you
want to dump the database:
mysqldump -u user -p database_name> outfile.sql
Command is wrong... should be:
mysqldump -u user -p password database_name> outfile.sql
I did catch that, but did not correct it in my post (considering it was a
direct quote).
-------
Actually,
mysqldump -u user -p password database_name> outfile.sql
is also the incorrect command. When providing the password in the command, there should
not be a space between the "-p" and the actual password. Try
mysqldump -u user -ppassword database_name> outfile.sql
and see if that gets you anywhere.
That's actually funny... I never put spaces in for the user or password
when using the short parameter method and had quickly tried with the
space before posting... I had tried with the user though and it work so
I had assumed it worked for password also.
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
On Tue, Aug 17, 2010 at 2:55 PM, Robert Cummings <[email protected]> wrote:
> On 10-08-17 02:45 PM, Mari Masuda wrote:
>>
>> On Aug 17, 2010, at 11:40 AM, tedd wrote:
>>
>>> At 2:17 PM -0400 8/17/10, Robert Cummings wrote:
>>>>
>>>> On 10-08-17 02:08 PM, tedd wrote:
>>>>>
>>>>> Hi gang:
>>>>>
>>>>>> At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote:
>>>>>> Easiest method, from the command line on the server from which you
>>>>>> want to dump the database:
>>>>>>
>>>>>> mysqldump -u user -p database_name> outfile.sql
>>>>
>>>> Command is wrong... should be:
>>>>
>>>> mysqldump -u user -p password database_name> outfile.sql
>>>
>>>
>>> I did catch that, but did not correct it in my post (considering it was a
>>> direct quote).
>>>
>>> -------
>>
>> Actually,
>>
>> mysqldump -u user -p password database_name> outfile.sql
>>
>> is also the incorrect command. When providing the password in the
>> command, there should not be a space between the "-p" and the actual
>> password. Try
>>
>> mysqldump -u user -ppassword database_name> outfile.sql
>>
>> and see if that gets you anywhere.
>
> That's actually funny... I never put spaces in for the user or password when
> using the short parameter method and had quickly tried with the space before
> posting
'Playful with passwords the hacker does not expect', says yoda
... I had tried with the user though and it work so I had assumed it
> worked for password also.
>
> Cheers,
> Rob.
> --
> E-Mail Disclaimer: Information contained in this message and any
> attached documents is considered confidential and legally protected.
> This message is intended solely for the addressee(s). Disclosure,
> copying, and distribution are prohibited unless authorized.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On Tue, Aug 17, 2010 at 3:00 PM, David Hutto <[email protected]> wrote:
> On Tue, Aug 17, 2010 at 2:55 PM, Robert Cummings <[email protected]> wrote:
>> On 10-08-17 02:45 PM, Mari Masuda wrote:
>>>
>>> On Aug 17, 2010, at 11:40 AM, tedd wrote:
>>>
>>>> At 2:17 PM -0400 8/17/10, Robert Cummings wrote:
>>>>>
>>>>> On 10-08-17 02:08 PM, tedd wrote:
>>>>>>
>>>>>> Hi gang:
>>>>>>
>>>>>>> At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote:
>>>>>>> Easiest method, from the command line on the server from which you
>>>>>>> want to dump the database:
>>>>>>>
>>>>>>> mysqldump -u user -p database_name> outfile.sql
>>>>>
>>>>> Command is wrong... should be:
>>>>>
>>>>> mysqldump -u user -p password database_name> outfile.sql
>>>>
>>>>
>>>> I did catch that, but did not correct it in my post (considering it was a
>>>> direct quote).
>>>>
>>>> -------
>>>
>>> Actually,
>>>
>>> mysqldump -u user -p password database_name> outfile.sql
>>>
>>> is also the incorrect command. When providing the password in the
>>> command, there should not be a space between the "-p" and the actual
>>> password. Try
>>>
>>> mysqldump -u user -ppassword database_name> outfile.sql
>>>
>>> and see if that gets you anywhere.
>>
>> That's actually funny... I never put spaces in for the user or password when
>> using the short parameter method and had quickly tried with the space before
>> posting
>
> 'Playful with passwords the hacker does not expect', says yoda
>
> ... I had tried with the user though and it work so I had assumed it
>> worked for password also.
>>
>> Cheers,
>> Rob.
>> --
>> E-Mail Disclaimer: Information contained in this message and any
>> attached documents is considered confidential and legally protected.
>> This message is intended solely for the addressee(s). Disclosure,
>> copying, and distribution are prohibited unless authorized.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
Or playfulness he expects, but privacy he reaps, said her celibate highness
--- End Message ---
--- Begin Message ---
On 10-08-17 03:00 PM, David Hutto wrote:
On Tue, Aug 17, 2010 at 2:55 PM, Robert Cummings<[email protected]> wrote:
On 10-08-17 02:45 PM, Mari Masuda wrote:
On Aug 17, 2010, at 11:40 AM, tedd wrote:
At 2:17 PM -0400 8/17/10, Robert Cummings wrote:
On 10-08-17 02:08 PM, tedd wrote:
Hi gang:
At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote:
Easiest method, from the command line on the server from which you
want to dump the database:
mysqldump -u user -p database_name> outfile.sql
Command is wrong... should be:
mysqldump -u user -p password database_name> outfile.sql
I did catch that, but did not correct it in my post (considering it was a
direct quote).
-------
Actually,
mysqldump -u user -p password database_name> outfile.sql
is also the incorrect command. When providing the password in the
command, there should not be a space between the "-p" and the actual
password. Try
mysqldump -u user -ppassword database_name> outfile.sql
and see if that gets you anywhere.
That's actually funny... I never put spaces in for the user or password when
using the short parameter method and had quickly tried with the space before
posting
'Playful with passwords the hacker does not expect', says yoda
I can't wait for 2050 when they release the new Star Wars super duper
master awesome director's milk-it edition with 3 seconds of Yoda smoking
a cigarette!
>:)
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
On Tue, Aug 17, 2010 at 3:04 PM, Robert Cummings <[email protected]> wrote:
> On 10-08-17 03:00 PM, David Hutto wrote:
>>
>> On Tue, Aug 17, 2010 at 2:55 PM, Robert Cummings<[email protected]>
>> wrote:
>>>
>>> On 10-08-17 02:45 PM, Mari Masuda wrote:
>>>>
>>>> On Aug 17, 2010, at 11:40 AM, tedd wrote:
>>>>
>>>>> At 2:17 PM -0400 8/17/10, Robert Cummings wrote:
>>>>>>
>>>>>> On 10-08-17 02:08 PM, tedd wrote:
>>>>>>>
>>>>>>> Hi gang:
>>>>>>>
>>>>>>>> At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote:
>>>>>>>> Easiest method, from the command line on the server from which
>>>>>>>> you
>>>>>>>> want to dump the database:
>>>>>>>>
>>>>>>>> mysqldump -u user -p database_name> outfile.sql
>>>>>>
>>>>>> Command is wrong... should be:
>>>>>>
>>>>>> mysqldump -u user -p password database_name> outfile.sql
>>>>>
>>>>>
>>>>> I did catch that, but did not correct it in my post (considering it was
>>>>> a
>>>>> direct quote).
>>>>>
>>>>> -------
>>>>
>>>> Actually,
>>>>
>>>> mysqldump -u user -p password database_name> outfile.sql
>>>>
>>>> is also the incorrect command. When providing the password in the
>>>> command, there should not be a space between the "-p" and the actual
>>>> password. Try
>>>>
>>>> mysqldump -u user -ppassword database_name> outfile.sql
>>>>
>>>> and see if that gets you anywhere.
>>>
>>> That's actually funny... I never put spaces in for the user or password
>>> when
>>> using the short parameter method and had quickly tried with the space
>>> before
>>> posting
>>
>> 'Playful with passwords the hacker does not expect', says yoda
>
> I can't wait for 2050 when they release the new Star Wars super duper master
> awesome director's milk-it edition with 3 seconds of Yoda smoking a
> cigarette!
But they'll put it in a pretty 'Happy meal', with lighter included.
>
>>:)
>
> Cheers,
> Rob.
> --
> E-Mail Disclaimer: Information contained in this message and any
> attached documents is considered confidential and legally protected.
> This message is intended solely for the addressee(s). Disclosure,
> copying, and distribution are prohibited unless authorized.
>
--- End Message ---
--- Begin Message ---
At 11:45 AM -0700 8/17/10, Mari Masuda wrote:
Actually,
mysqldump -u user -p password database_name > outfile.sql
is also the incorrect command. When providing the password in the
command, there should not be a space between the "-p" and the actual
password. Try
mysqldump -u user -ppassword database_name > outfile.sql
and see if that gets you anywhere.
Bingo -- that worked.
It's interesting that a space is optional between -u and user, but
required to be absent between -p and password. Seems not symmetrical
to me.
Many thanks.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
Hi gang:
The subject line says it all.
How secure is a .htaccess file to store passwords and other sensitive stuff?
Can a .htaccess file be viewed remotely?
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---