Re: [PHP] PHP doesn't see php.ini

2009-06-27 Thread Tir
Problem is solved. I should have added path to PHP root directory to PATH 
environment variable. 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] information feed

2009-06-27 Thread madunix
I am running several web servers (Linux/Apache/PHP/MySQL) with  alot of
statistical data, I got multiple request from different providers
they asked us to implement a mechanism through which the data can be
shared with them. at the moment we don't have a direct data feed
service.
I would like to know out of your experience how do you implenet data
feed services, am thinking now to provide the data through an FTP or
in a predefined email format.

Thanks
madunix

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] information feed

2009-06-27 Thread Ashley Sheridan
On Sat, 2009-06-27 at 15:21 +0200, madunix wrote:
> I am running several web servers (Linux/Apache/PHP/MySQL) with  alot of
> statistical data, I got multiple request from different providers
> they asked us to implement a mechanism through which the data can be
> shared with them. at the moment we don't have a direct data feed
> service.
> I would like to know out of your experience how do you implenet data
> feed services, am thinking now to provide the data through an FTP or
> in a predefined email format.
> 
> Thanks
> madunix
> 

Whats wrong with an RSS implementation?


Thanks
Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] information feed

2009-06-27 Thread Bastien Koert
On Sat, Jun 27, 2009 at 10:28 AM, Ashley
Sheridan wrote:
> On Sat, 2009-06-27 at 15:21 +0200, madunix wrote:
>> I am running several web servers (Linux/Apache/PHP/MySQL) with  alot of
>> statistical data, I got multiple request from different providers
>> they asked us to implement a mechanism through which the data can be
>> shared with them. at the moment we don't have a direct data feed
>> service.
>> I would like to know out of your experience how do you implenet data
>> feed services, am thinking now to provide the data through an FTP or
>> in a predefined email format.
>>
>> Thanks
>> madunix
>>
>
> Whats wrong with an RSS implementation?
>
>
> Thanks
> Ash
> www.ashleysheridan.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

web service?

-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fixing new lines from in an email?

2009-06-27 Thread tedd

At 11:27 AM -0500 6/26/09, Adam Williams wrote:
I have staff fill out a form that contains a  with their 
problem description and emailed to me when they click submit.  Staff 
will press enter in the text area, but I'm having problems 
converting the \r\n into a new line in the email that is sent to me, 
here is the code:


-snip-

Adam:

There's always confusion as to what you do with data collected from a 
form. In your case, you just want the data sent to you via email and 
for the new lines to be properly converted into something that 
resembles what was entered, right?


I think this example might help:

http://www.webbytedd.com//email-form/index.php

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mysql_query blocking

2009-06-27 Thread Daniel Kolbo
Hello,

When a MySQL table is locked a php call of mysql_query() that requires
that table will hang as the request blocks at the MySQL server until the
table is unlocked.  Is there a way to stop a mysql_query from hanging
(by setting a time limit)?

The php.ini directive max_execution_time does not help b/c:
"Note: The set_time_limit() function and the configuration directive
max_execution_time only affect the execution time of the script itself.
Any time spent on activity that happens outside the execution of the
script such as system calls using system(), stream operations, database
queries, etc. is not included when determining the maximum time that the
script has been running."

The my.ini directive table_lock_wait_timeout does not work either b/c
from MySQL:
"This variable currently is unused. "
(I am using mysql v5.1)

I do not want to bluntly stop this from the apache level.

How does one place a time limit on the execution of mysql_query()?

Thanks for your help,
dK


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Ashley Sheridan
On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:
> Hello,
> 
> When a MySQL table is locked a php call of mysql_query() that requires
> that table will hang as the request blocks at the MySQL server until the
> table is unlocked.  Is there a way to stop a mysql_query from hanging
> (by setting a time limit)?
> 
> The php.ini directive max_execution_time does not help b/c:
> "Note: The set_time_limit() function and the configuration directive
> max_execution_time only affect the execution time of the script itself.
> Any time spent on activity that happens outside the execution of the
> script such as system calls using system(), stream operations, database
> queries, etc. is not included when determining the maximum time that the
> script has been running."
> 
> The my.ini directive table_lock_wait_timeout does not work either b/c
> from MySQL:
> "This variable currently is unused. "
> (I am using mysql v5.1)
> 
> I do not want to bluntly stop this from the apache level.
> 
> How does one place a time limit on the execution of mysql_query()?
> 
> Thanks for your help,
> dK
> 
> 
It depends on what type of table you have, MyISAM blocks at table level
for instance, while InnoDB locks at row level.

Thanks
Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Daniel Kolbo


Daniel Kolbo wrote:
> Hello,
> 
> When a MySQL table is locked a php call of mysql_query() that requires
> that table will hang as the request blocks at the MySQL server until the
> table is unlocked.  Is there a way to stop a mysql_query from hanging
> (by setting a time limit)?
> 
> The php.ini directive max_execution_time does not help b/c:
> "Note: The set_time_limit() function and the configuration directive
> max_execution_time only affect the execution time of the script itself.
> Any time spent on activity that happens outside the execution of the
> script such as system calls using system(), stream operations, database
> queries, etc. is not included when determining the maximum time that the
> script has been running."
> 
> The my.ini directive table_lock_wait_timeout does not work either b/c
> from MySQL:
> "This variable currently is unused. "
> (I am using mysql v5.1)
> 
> I do not want to bluntly stop this from the apache level.
> 
> How does one place a time limit on the execution of mysql_query()?
> 
> Thanks for your help,
> dK
> 
> 

Even the apache TimeOut directive does not seem to work in this situation.

Any help would be appreciated.

Thanks,
dK

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Daniel Kolbo
Ashley Sheridan wrote:
> On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:
>> Hello,
>>
>> When a MySQL table is locked a php call of mysql_query() that requires
>> that table will hang as the request blocks at the MySQL server until the
>> table is unlocked.  Is there a way to stop a mysql_query from hanging
>> (by setting a time limit)?
>>
>> The php.ini directive max_execution_time does not help b/c:
>> "Note: The set_time_limit() function and the configuration directive
>> max_execution_time only affect the execution time of the script itself.
>> Any time spent on activity that happens outside the execution of the
>> script such as system calls using system(), stream operations, database
>> queries, etc. is not included when determining the maximum time that the
>> script has been running."
>>
>> The my.ini directive table_lock_wait_timeout does not work either b/c
>> from MySQL:
>> "This variable currently is unused. "
>> (I am using mysql v5.1)
>>
>> I do not want to bluntly stop this from the apache level.
>>
>> How does one place a time limit on the execution of mysql_query()?
>>
>> Thanks for your help,
>> dK
>>
>>
> It depends on what type of table you have, MyISAM blocks at table level
> for instance, while InnoDB locks at row level.
> 
> Thanks
> Ash
> www.ashleysheridan.co.uk
> 
> 

I'm using InnoDB.
But either way how do you place a time limit on mysql_query()?
Thanks,
dK

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Ashley Sheridan
On Sat, 2009-06-27 at 16:03 -0400, Daniel Kolbo wrote:
> Ashley Sheridan wrote:
> > On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:
> >> Hello,
> >>
> >> When a MySQL table is locked a php call of mysql_query() that requires
> >> that table will hang as the request blocks at the MySQL server until the
> >> table is unlocked.  Is there a way to stop a mysql_query from hanging
> >> (by setting a time limit)?
> >>
> >> The php.ini directive max_execution_time does not help b/c:
> >> "Note: The set_time_limit() function and the configuration directive
> >> max_execution_time only affect the execution time of the script itself.
> >> Any time spent on activity that happens outside the execution of the
> >> script such as system calls using system(), stream operations, database
> >> queries, etc. is not included when determining the maximum time that the
> >> script has been running."
> >>
> >> The my.ini directive table_lock_wait_timeout does not work either b/c
> >> from MySQL:
> >> "This variable currently is unused. "
> >> (I am using mysql v5.1)
> >>
> >> I do not want to bluntly stop this from the apache level.
> >>
> >> How does one place a time limit on the execution of mysql_query()?
> >>
> >> Thanks for your help,
> >> dK
> >>
> >>
> > It depends on what type of table you have, MyISAM blocks at table level
> > for instance, while InnoDB locks at row level.
> > 
> > Thanks
> > Ash
> > www.ashleysheridan.co.uk
> > 
> > 
> 
> I'm using InnoDB.
> But either way how do you place a time limit on mysql_query()?
> Thanks,
> dK
> 
I've not seen this done before, but it should only be row locking if
you're using InnoDB. What queries are you running that are affecting a
script that badly?

Thanks
Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Daniel Kolbo
Ashley Sheridan wrote:
> On Sat, 2009-06-27 at 16:03 -0400, Daniel Kolbo wrote:
>> Ashley Sheridan wrote:
>>> On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:
 Hello,

 When a MySQL table is locked a php call of mysql_query() that requires
 that table will hang as the request blocks at the MySQL server until the
 table is unlocked.  Is there a way to stop a mysql_query from hanging
 (by setting a time limit)?

 The php.ini directive max_execution_time does not help b/c:
 "Note: The set_time_limit() function and the configuration directive
 max_execution_time only affect the execution time of the script itself.
 Any time spent on activity that happens outside the execution of the
 script such as system calls using system(), stream operations, database
 queries, etc. is not included when determining the maximum time that the
 script has been running."

 The my.ini directive table_lock_wait_timeout does not work either b/c
 from MySQL:
 "This variable currently is unused. "
 (I am using mysql v5.1)

 I do not want to bluntly stop this from the apache level.

 How does one place a time limit on the execution of mysql_query()?

 Thanks for your help,
 dK


>>> It depends on what type of table you have, MyISAM blocks at table level
>>> for instance, while InnoDB locks at row level.
>>>
>>> Thanks
>>> Ash
>>> www.ashleysheridan.co.uk
>>>
>>>
>> I'm using InnoDB.
>> But either way how do you place a time limit on mysql_query()?
>> Thanks,
>> dK
>>
> I've not seen this done before, but it should only be row locking if
> you're using InnoDB. What queries are you running that are affecting a
> script that badly?
> 
> Thanks
> Ash
> www.ashleysheridan.co.uk
> 
> 
I issue a 'lock tables tablename write' and do some work.  This is to be
expected.  I want a way that to stop mysql_query() from just waiting for
 the mysql server.
`

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] why is this shell_exec() failing to execute my shell to create a symlink?

2009-06-27 Thread Govinda

this code:

$testOutput";
	echo "testOutput2:$testOutput2firstCMD= 
$firstCMD";
	echo "firstOutput:$firstOutputsecondCMD= 
$secondCMD";
	echo "secondOutput:$secondOutputthirdCMD= 
$thirdCMD";


?>

is not producing the symlink that I think it should.  (?!?)  (neither  
in the dir/ where this script lives, nor in the testDir/ where I am  
actually trying to create it, on the fly.

Server is not in safe mode.



Govinda
govinda.webdnat...@gmail.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Tom Worster
On 6/27/09 3:15 PM, "Daniel Kolbo"  wrote:

> When a MySQL table is locked a php call of mysql_query() that requires
> that table will hang as the request blocks at the MySQL server until the
> table is unlocked.  Is there a way to stop a mysql_query from hanging
> (by setting a time limit)?

would it be possible to test for presence of the lock before issuing the
query that would block? if so, you could check the lock periodically until
your time limit is up. would achieve you you're looking for?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] symLink Test also failing. (then is it a permissions issue? - also see my previous post about shell_exec failing)

2009-06-27 Thread Govinda

and in this test, $symLinkTest seems to be returning false, every time.

$symLinkTarget='testDir/amex_cid.gif';
$SymLinkNew='testDir/myccGOV.gif';
$symLinkTest=symlink($symLinkTarget, $SymLinkNew);

echo "symLinkTest=";
echo var_dump($symLinkTest);

--

returns:
symLinkTest=bool(false)

--

the amex_cid.gif' file is definitely there in the testDir/ dir.

??


Govinda
govinda.webdnat...@gmail.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Bastien Koert
Why issue/do a lock at all? Shouldn't need a large lock at read

bastien

On Saturday, June 27, 2009, Daniel Kolbo  wrote:
> Ashley Sheridan wrote:
>> On Sat, 2009-06-27 at 16:03 -0400, Daniel Kolbo wrote:
>>> Ashley Sheridan wrote:
 On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:
> Hello,
>
> When a MySQL table is locked a php call of mysql_query() that requires
> that table will hang as the request blocks at the MySQL server until the
> table is unlocked.  Is there a way to stop a mysql_query from hanging
> (by setting a time limit)?
>
> The php.ini directive max_execution_time does not help b/c:
> "Note: The set_time_limit() function and the configuration directive
> max_execution_time only affect the execution time of the script itself.
> Any time spent on activity that happens outside the execution of the
> script such as system calls using system(), stream operations, database
> queries, etc. is not included when determining the maximum time that the
> script has been running."
>
> The my.ini directive table_lock_wait_timeout does not work either b/c
> from MySQL:
> "This variable currently is unused. "
> (I am using mysql v5.1)
>
> I do not want to bluntly stop this from the apache level.
>
> How does one place a time limit on the execution of mysql_query()?
>
> Thanks for your help,
> dK
>
>
 It depends on what type of table you have, MyISAM blocks at table level
 for instance, while InnoDB locks at row level.

 Thanks
 Ash
 www.ashleysheridan.co.uk 


>>> I'm using InnoDB.
>>> But either way how do you place a time limit on mysql_query()?
>>> Thanks,
>>> dK
>>>
>> I've not seen this done before, but it should only be row locking if
>> you're using InnoDB. What queries are you running that are affecting a
>> script that badly?
>>
>> Thanks
>> Ash
>> www.ashleysheridan.co.uk 
>>
>>
> I issue a 'lock tables tablename write' and do some work.  This is to be
> expected.  I want a way that to stop mysql_query() from just waiting for
>  the mysql server.
> `
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Bastien Koert
On Saturday, June 27, 2009, Bastien Koert  wrote:
> Why issue/do a lock at all? Shouldn't need a large lock at read
>
> bastien
>
> On Saturday, June 27, 2009, Daniel Kolbo


  wrote

>> Ashley Sheridan wrote:
>>> On Sat, 2009-06-27 at 16:03 -0400, Daniel Kolbo wrote:
 Ashley Sheridan wrote:
> On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:
>> Hello,
>>
>> When a MySQL table is locked a php call of mysql_query() that requires
>> that table will hang as the request blocks at the MySQL server until the
>> table is unlocked.  Is there a way to stop a mysql_query from hanging
>> (by setting a time limit)?
>>
>> The php.ini directive max_execution_time does not help b/c:
>> "Note: The set_time_limit() function and the configuration directive
>> max_execution_time only affect the execution time of the script itself.
>> Any time spent on activity that happens outside the execution of the
>> script such as system calls using system(), stream operations, database
>> queries, etc. is not included when determining the maximum time that the
>> script has been running."
>>
>> The my.ini directive table_lock_wait_timeout does not work either b/c
>> from MySQL:
>> "This variable currently is unused. "
>> (I am using mysql v5.1)
>>
>> I do not want to bluntly stop this from the apache level.
>>
>> How does one place a time limit on the execution of mysql_query()?
>>
>> Thanks for your help,
>> dK
>>
>>
> It depends on what type of table you have, MyISAM blocks at table level
> for instance, while InnoDB locks at row level.
>
> Thanks
> Ash
> www.ashleysheridan.co.uk  
>
>
 I'm using InnoDB.
 But either way how do you place a time limit on mysql_query()?
 Thanks,
 dK

>>> I've not seen this done before, but it should only be row locking if
>>> you're using InnoDB. What queries are you running that are affecting a
>>> script that badly?
>>>
>>> Thanks
>>> Ash
>>> www.ashleysheridan.co.uk  
>>>
>>>
>> I issue a 'lock tables tablename write' and do some work.  This is to be
>> expected.  I want a way that to stop mysql_query() from just waiting for
>>  the mysql server.
>> `
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> --
>
> Bastien
>
> Cat, the other other white meat
>

-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Phpster



Bastien

Sent from my iPod

On Jun 27, 2009, at 4:13 PM, Daniel Kolbo  wrote:


Ashley Sheridan wrote:

On Sat, 2009-06-27 at 16:03 -0400, Daniel Kolbo wrote:

Ashley Sheridan wrote:

On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:

Hello,

When a MySQL table is locked a php call of mysql_query() that  
requires
that table will hang as the request blocks at the MySQL server  
until the
table is unlocked.  Is there a way to stop a mysql_query from  
hanging

(by setting a time limit)?

The php.ini directive max_execution_time does not help b/c:
"Note: The set_time_limit() function and the configuration  
directive
max_execution_time only affect the execution time of the script  
itself.
Any time spent on activity that happens outside the execution of  
the
script such as system calls using system(), stream operations,  
database
queries, etc. is not included when determining the maximum time  
that the

script has been running."

The my.ini directive table_lock_wait_timeout does not work  
either b/c

from MySQL:
"This variable currently is unused. "
(I am using mysql v5.1)

I do not want to bluntly stop this from the apache level.

How does one place a time limit on the execution of mysql_query()?

Thanks for your help,
dK


It depends on what type of table you have, MyISAM blocks at table  
level

for instance, while InnoDB locks at row level.

Thanks
Ash
www.ashleysheridan.co.uk



I'm using InnoDB.
But either way how do you place a time limit on mysql_query()?
Thanks,
dK


I've not seen this done before, but it should only be row locking if
you're using InnoDB. What queries are you running that are  
affecting a

script that badly?

Thanks
Ash
www.ashleysheridan.co.uk


I issue a 'lock tables tablename write' and do some work.  This is  
to be
expected.  I want a way that to stop mysql_query() from just waiting  
for

the mysql server.
`

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





Further thought, do you have indexes on the table?


Bastien

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Daniel Kolbo
Tom Worster wrote:
> On 6/27/09 3:15 PM, "Daniel Kolbo"  wrote:
> 
>> When a MySQL table is locked a php call of mysql_query() that requires
>> that table will hang as the request blocks at the MySQL server until the
>> table is unlocked.  Is there a way to stop a mysql_query from hanging
>> (by setting a time limit)?
> 
> would it be possible to test for presence of the lock before issuing the
> query that would block? if so, you could check the lock periodically until
> your time limit is up. would achieve you you're looking for?
> 
> 
> 
it would still be possible that after checking but before issuing the
query the table's could be locked - albeit a much smaller chance.

Thanks for the input,
dK

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Daniel Kolbo
Bastien Koert wrote:
> Why issue/do a lock at all? Shouldn't need a large lock at read
> 
> bastien
> 
> On Saturday, June 27, 2009, Daniel Kolbo  wrote:
>> Ashley Sheridan wrote:
>>> On Sat, 2009-06-27 at 16:03 -0400, Daniel Kolbo wrote:
 Ashley Sheridan wrote:
> On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:
>> Hello,
>>
>> When a MySQL table is locked a php call of mysql_query() that requires
>> that table will hang as the request blocks at the MySQL server until the
>> table is unlocked.  Is there a way to stop a mysql_query from hanging
>> (by setting a time limit)?
>>
>> The php.ini directive max_execution_time does not help b/c:
>> "Note: The set_time_limit() function and the configuration directive
>> max_execution_time only affect the execution time of the script itself.
>> Any time spent on activity that happens outside the execution of the
>> script such as system calls using system(), stream operations, database
>> queries, etc. is not included when determining the maximum time that the
>> script has been running."
>>
>> The my.ini directive table_lock_wait_timeout does not work either b/c
>> from MySQL:
>> "This variable currently is unused. "
>> (I am using mysql v5.1)
>>
>> I do not want to bluntly stop this from the apache level.
>>
>> How does one place a time limit on the execution of mysql_query()?
>>
>> Thanks for your help,
>> dK
>>
>>
> It depends on what type of table you have, MyISAM blocks at table level
> for instance, while InnoDB locks at row level.
>
> Thanks
> Ash
> www.ashleysheridan.co.uk 
>
>
 I'm using InnoDB.
 But either way how do you place a time limit on mysql_query()?
 Thanks,
 dK

>>> I've not seen this done before, but it should only be row locking if
>>> you're using InnoDB. What queries are you running that are affecting a
>>> script that badly?
>>>
>>> Thanks
>>> Ash
>>> www.ashleysheridan.co.uk 
>>>
>>>
>> I issue a 'lock tables tablename write' and do some work.  This is to be
>> expected.  I want a way that to stop mysql_query() from just waiting for
>>  the mysql server.
>> `
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 
a different user (user who is updating) would be doing the lock.

thanks,
dK

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Daniel Kolbo
Phpster wrote:
> 
> 
> Bastien
> 
> Sent from my iPod
> 
> On Jun 27, 2009, at 4:13 PM, Daniel Kolbo  wrote:
> 
>> Ashley Sheridan wrote:
>>> On Sat, 2009-06-27 at 16:03 -0400, Daniel Kolbo wrote:
 Ashley Sheridan wrote:
> On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:
>> Hello,
>>
>> When a MySQL table is locked a php call of mysql_query() that
>> requires
>> that table will hang as the request blocks at the MySQL server
>> until the
>> table is unlocked.  Is there a way to stop a mysql_query from hanging
>> (by setting a time limit)?
>>
>> The php.ini directive max_execution_time does not help b/c:
>> "Note: The set_time_limit() function and the configuration directive
>> max_execution_time only affect the execution time of the script
>> itself.
>> Any time spent on activity that happens outside the execution of the
>> script such as system calls using system(), stream operations,
>> database
>> queries, etc. is not included when determining the maximum time
>> that the
>> script has been running."
>>
>> The my.ini directive table_lock_wait_timeout does not work either b/c
>> from MySQL:
>> "This variable currently is unused. "
>> (I am using mysql v5.1)
>>
>> I do not want to bluntly stop this from the apache level.
>>
>> How does one place a time limit on the execution of mysql_query()?
>>
>> Thanks for your help,
>> dK
>>
>>
> It depends on what type of table you have, MyISAM blocks at table
> level
> for instance, while InnoDB locks at row level.
>
> Thanks
> Ash
> www.ashleysheridan.co.uk
>
>
 I'm using InnoDB.
 But either way how do you place a time limit on mysql_query()?
 Thanks,
 dK

>>> I've not seen this done before, but it should only be row locking if
>>> you're using InnoDB. What queries are you running that are affecting a
>>> script that badly?
>>>
>>> Thanks
>>> Ash
>>> www.ashleysheridan.co.uk
>>>
>>>
>> I issue a 'lock tables tablename write' and do some work.  This is to be
>> expected.  I want a way that to stop mysql_query() from just waiting for
>> the mysql server.
>> `
>>
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> 
> 
> Further thought, do you have indexes on the table?
> 
> 
> Bastien
> 
Yes.
The question is not about MySQL efficiency - i'll leave that to the
MySQL email group.
This question is about putting in place PHP safe guards.

Thanks,
dK

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] why is this shell_exec() failing to execute my shell to create a symlink?

2009-06-27 Thread Jonathan Tapicer
Make sure that:

- The user executing the script (apache I presume) has execute
permissions on ls and ln binaries.
- The user executing the script has write persmissions on the
directory you are trying to write, and read permissions where you do
ls.
- This will probably help: put the full binary path for ls and ln, it
depends on your OS, but probably they are: /bin/ls and /bin/ln

If that doesn't help, can you show us the output?

Jonathan

On Sat, Jun 27, 2009 at 5:46 PM, Govinda wrote:
> this code:
>
> 
>        $testOutput = shell_exec("ls");
>
>        $where2cd2='testDir/';
>        $firstCMD="cd $where2cd2";
>         $firstOutput = shell_exec("$firstCMD");
>        // $firstOutput = shell_exec('cd testDir/');
>        $testOutput2 = shell_exec("ls");
>
>        $secondCMD='ln -s amex_cid.gif myccGOV.gif';
>        $secondOutput = shell_exec("$secondCMD");
>
>        echo "testOutput:$testOutput";
>        echo
> "testOutput2:$testOutput2firstCMD=$firstCMD";
>        echo
> "firstOutput:$firstOutputsecondCMD=$secondCMD";
>        echo
> "secondOutput:$secondOutputthirdCMD=$thirdCMD";
>
> ?>
>
> is not producing the symlink that I think it should.  (?!?)  (neither in the
> dir/ where this script lives, nor in the testDir/ where I am actually trying
> to create it, on the fly.
> Server is not in safe mode.
>
>
> 
> Govinda
> govinda.webdnat...@gmail.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5.2.9 Apache 2.2.11 outputs php code on Vista

2009-06-27 Thread ioan...@btinternet.com
Solved: In Windows 'Explorer' in Vista, set User permissions for the 
htdocs - go to htdocs folder within the Apache folders, right click, 
Properties, Security, Edit, select your name as User, allow Full 
Control, Modify etc.  Now open the files you created like test.php or 
index1.html and save them again.  Then they will be accessible like 
http://localhost/test.php etc.  Whereas without this they will be 'file 
not found'.


Even if there is only one User in Windows and it is also the 
Administrator, you need to be recognised as Administrator for the action 
being done, normal log on to Windows will be as User only.


I got to the above solution when I noticed the 
http://localhost/index.html showed Apache working, in the browser using 
the index.html that comes with the installation, but index1.html saved 
in the same folder did not appear in Windows Explorer and also was 'page 
not found' in the browser, even though it saved OK and was visible and 
loadable in the html editor. 

php now also works with Apache, I think I was missing from httpd.conf 
within  :


   AddHandler application/x-httpd-php .php
   AddHandler application/x-httpd-php-source .phps


John

ioan...@btinternet.com wrote:
I still have the strange thing of saving a file in htdocs within the 
Apache folders (on Vista, you need to right click on Notepad from 
Start and Run as Administrator), but then not seeing it in Windows 
Explorer - must be something to do with UAC.  But main problem is 
getting php to work with Apache.  Please let me know if there is 
anywhere else I should look.  I took the time to read the php 
installation notes carefully and the Apache notes (which seemed to be 
mostly about meeting someone in a computer fair to check their 
fingerprint, I joke), but to no avail.


Does anyone have a working, full, step-by-step set of instructions for 
Vista, PHP 5.2.9 Apache 2.2.11 ?


Thanks,

John


Original post [ed]

I have a working Apache 2.2.11 server and php 5.2.9 installed.

APACHE CONFIGURATION

Files are in: C:/Program Files/Apache Software Foundation/Apache2.2/
 
As per installation instructions, Apache httpd.conf is amended to add 
at the end of the LoadModule lines (though not between any tags):


   LoadModule php5_module "C:/PHP/php5apache2_2.dll"

   PHPIniDir "C:/PHP"

And at the end of the file:

   AddModule mod_php5.c

(Would this be .conf, not .c?). , (per php notes 'Installing as an 
Apache module').  On clicking Start Apache http server, this gives 
"Invalid command 'AddModule' perhaps misspelled or defined by a module 
not included in server configuration."  The PHP Installation guide 
says to add this at the end of the AddModule section.  There is no 
AddModule in the default http.conf of Apache 2.2.11.  So for now have 
commented it out.


Between  and , I have added:

   AddType application/x-httpd-php .php


PHP CONFIGURATION

The php.ini file is in C:/PHP.

php.ini has been amended as follows:
doc_root = "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs"

WINDOWS CONFIGURATION

I have added ;C:/PHP to the end of the string for Environment Variables.

I have re-booted and re-started.  I am testing this file:

C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php

which has


and this outputs as code rather than as 'test' or it does not output 
at all.


When I start the Apache http server, I get:

httpd.exe: Could not reliably determine the server's fully qualified 
domain name

, using 10.0.0.4 for ServerName
(OS 10048)Only one usage of each socket address (protocol/network 
address/port)

is normally permitted.  : make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

My ISP has a dynamic IP address system, what do I use for ServerName?  
Do I need a static address or registered web site name to run on home 
computer?


Apache httpd.conf has:
# ServerName gives the name and port that the server uses to identify 
itself.
# This can often be determined automatically, but we recommend you 
specify

# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP 
address here.

#
#ServerName

Any idea what might be wrong with the php code showing?

Thanks,

John






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5.2.9 Apache 2.2.11 outputs php code on Vista

2009-06-27 Thread ioan...@btinternet.com

...though phpinfo seems to work fine without this handler.

ioan...@btinternet.com wrote:
php now also works with Apache, I think I was missing from httpd.conf 
within  :


   AddHandler application/x-httpd-php .php
   AddHandler application/x-httpd-php-source .phps


John




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql_query blocking

2009-06-27 Thread Phpster



On Jun 27, 2009, at 7:17 PM, Daniel Kolbo  wrote:


Phpster wrote:



Bastien

Sent from my iPod

On Jun 27, 2009, at 4:13 PM, Daniel Kolbo  wrote:


Ashley Sheridan wrote:

On Sat, 2009-06-27 at 16:03 -0400, Daniel Kolbo wrote:

Ashley Sheridan wrote:

On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:

Hello,

When a MySQL table is locked a php call of mysql_query() that
requires
that table will hang as the request blocks at the MySQL server
until the
table is unlocked.  Is there a way to stop a mysql_query from  
hanging

(by setting a time limit)?

The php.ini directive max_execution_time does not help b/c:
"Note: The set_time_limit() function and the configuration  
directive

max_execution_time only affect the execution time of the script
itself.
Any time spent on activity that happens outside the execution  
of the

script such as system calls using system(), stream operations,
database
queries, etc. is not included when determining the maximum time
that the
script has been running."

The my.ini directive table_lock_wait_timeout does not work  
either b/c

from MySQL:
"This variable currently is unused. "
(I am using mysql v5.1)

I do not want to bluntly stop this from the apache level.

How does one place a time limit on the execution of mysql_query 
()?


Thanks for your help,
dK



It depends on what type of table you have, MyISAM blocks at table
level
for instance, while InnoDB locks at row level.

Thanks
Ash
www.ashleysheridan.co.uk



I'm using InnoDB.
But either way how do you place a time limit on mysql_query()?
Thanks,
dK

I've not seen this done before, but it should only be row locking  
if
you're using InnoDB. What queries are you running that are  
affecting a

script that badly?

Thanks
Ash
www.ashleysheridan.co.uk


I issue a 'lock tables tablename write' and do some work.  This is  
to be
expected.  I want a way that to stop mysql_query() from just  
waiting for

the mysql server.
`

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





Further thought, do you have indexes on the table?


Bastien


Yes.
The question is not about MySQL efficiency - i'll leave that to the
MySQL email group.
This question is about putting in place PHP safe guards.

Thanks,
dK



So it's a concurrency question. There are a couple of schools of  
thought here:


Flag the record on select before the update to 'lock' it to a specific  
user. Any other user would get a readonly version of the data  
( perhaps with a notice indicating another user has the lock )


Another common option is to accept both changes into a queue and then  
deciding who's data shall be the final version.


This would add a ton of complexity fir very little gain. IMHO the  
first option is better as you could build functionality to track the  
record request and notify the second user when that data has been  
committed and the 'lock' flag turned 'off'.


Bastien


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php