php-general Digest 16 Jul 2006 02:53:26 -0000 Issue 4242

2006-07-15 Thread php-general-digest-help

php-general Digest 16 Jul 2006 02:53:26 - Issue 4242

Topics (messages 239508 through 239511):

php-head-shrink  WAS: Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock
239508 by: Paul Scott

Re: Zend Studio, phpMyAdmin, and mysql.sock
239509 by: tedd

strange behavior
239510 by: jekillen
239511 by: Richard Lynch

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:
php-general@lists.php.net


--
---BeginMessage---
--=neXtPaRt_1152981398
Content-Type: text/plain
Content-Transfer-Encoding: 7bit


My IBM laptop and I are having relationship issues...

--Paul


--=neXtPaRt_1152981398
Content-Type: text/plain;

All Email originating from UWC is covered by disclaimer  
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

--=neXtPaRt_1152981398--
---End Message---
---BeginMessage---
At 5:05 PM +1000 7/15/06, Kevin Waterson wrote:
This one time, at band camp, Dave M G [EMAIL PROTECTED] wrote:
 
 Please understand that I was *hoping* for advice here, as Zend and PHP
 are surely highly correlated. But I apologize if I came across as if I
 *expected* answers.

You raise an interesting point. Whilst PHP uses the Zend Engine it is the
only Zend product in use as far as I know. Zend have an array of other
commercial products that are built with PHP, but are no different than
any other commercial venture.

Being that these products are commercial in nature, should not they
be supporting thier own products, rather than relying on the good
will of the open source/PHP folks for tech support? If we should support
Zend products, why not other commercial applications also?
Is Zend hoping for volunteer contributions for commercial enterprises?
Should we support Zend business partners also?


Kind regards
Kevin

Kevin:

You raise obvious points, which few would disagree -- we shouldn't be expected 
to be the free support for a commercial product. However, if a php developer 
is looking for other developers who may have had similar experiences with Zend, 
or Apache, or whatever as it relates to php, is this not the forum for those 
types of questions?

Again, just wondering where to draw the line.

tedd
-- 

http://sperling.com  http://ancientstones.com  http://earthstones.com
---End Message---
---BeginMessage---

Hello:
I have a directory on a server that has php code that creates and 
writes to directories as such;  /tiles_.*/.
Each directory with a matching name has graphics files written to it. 
i'm trying to write a script the will
eliminate the graphics files and the directories they are in 
(tiles_.*). The present code is:

?php
function prune()
  {
   $f = 0;
   $pat = 'tiles_.*';
   $view = array();
   $t = array();
   $str = '';
   $start = opendir('.');
   //printHello???br; debug code
   while($lst = readdir($start))
   {
if(ereg($pat, $lst))
  {
   $t[$f] = $lst;
   $str .= $t[$f].'br'; //debug code
  }
 $f++;
}
   rewind($start);
   closedir($start);
   //print $str; debug codethe array $t has all valid 
values at this point.

   for($f = 0; $f  count($t); $f++)
 {$tmp = $t[$f];
  chdir($tmp);
  $dir = opendir($tmp);
  $r = 0;
  while($i = readdir($dir))
   {
@unlink($i);
$r++;
   };
   rewind($dir);
   closedir($dir);
   unset($dir);
   chdir('../');
   rmdir($tmp);
  }

  }
prune();
?
The problem is that each time the for loop tries to chdir to an array 
$t item, errors regarding invalid resources and none existent files are 
generated.
If I use chdir('./'.$tmp) and opendir('./'.$tmp) the code removes all 
the files in the directory the script is located in, including the 
script file itself.
So, I am thinking that, in this case, the directories aren't even 
changed when the @unlink() line is reached and unlink() only sees the 
current
directory files and not included directories, and removes everything 
that isn't a directory.

Here is a sample of the errors generated:
Warning: chdir() [function.chdir]: No such file or directory (errno 2) 
in (path)/prune.php on line 30 // (all resources used based on this are 
invalid)

and;
Warning: opendir(tiles_9215fd05) [function.opendir]: failed to 

Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-15 Thread Dave M G

PHP List,

My apologies to any and all that I may have offended for bringing up 
Zend specific issues here.


I understand that PHP is developed by a huge community of developers 
whose efforts I appreciate very much. By stating that Zend is the 
company where PHP originates, I was not trying to state that they have 
any obligation to handle Zend Studio issues here on this list, or that 
this list is obligated to deal with Zend issue, or that their 
development contributions should eclipse the greater community.


I was only surprised by the initial response which seemed to me to be a 
very hard line stance against any Zend related questions.


Please understand that I was *hoping* for advice here, as Zend and PHP 
are surely highly correlated. But I apologize if I came across as if I 
*expected* answers.


The original issue that caused me to post here has now definitely turned 
into a PHP issue, which I will encapsulate in a different posting from 
this apology. So, if issues of Zend can be put aside, I'd like to seek 
advice on how to get my local PHP 5 installation working again.


Thanks to all members of this list for continuing to make PHP a great 
scripting language, and for making this list a great source of support.


--
Dave M G

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-15 Thread Dave M G

PHP List,

As was suggested on this list by Paul and Richard, I've resolved the 
Zend studio/MySQL socket issue by creating a symbolic link from 
/tmp/mysql.socl to /var/run/mysqld/mysqld.sock.

( ln -s /var/run/mysqld/mysql.sock /tmp/mysql.sock )

But, clearly in my earlier attempts to find a solution, I've munged up 
my php.ini file or something, because now not only does phpMyAdmin not 
connect, no PHP script that I run locally will work.


To resolve this, I tried to retrace my steps and put everything back the 
way it was. I also reinstalled MySQL, PHP, and phpMyAdmin from the 
Ubuntu repositories using apt-get.


Despite these efforts, whatever it is that I've done to mess up my 
system remains in place.


When I start a PHP script that calls upon MySQL, I get the following error:
Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to 
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in 
/web_sites/web/db_fns.php on line 6.


So far as I can remember, the only places I made edits were in 
/etc/php5/apache2/php.ini, and /etc/mysql/my.cnf.


In /etc/php5/apache2/php.ini, here is what the relevant section looks 
like now:


- - - - - - - - -
; Default port number for mysql_connect().  If unset, mysql_connect() 
will use

; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will 
only look

; at MYSQL_PORT.
mysql.default_port = 3306

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
- - - - - - - - -

My understanding of the above is that if the socket variable is left 
empty, it should go with the MySQL default. I have tried specifying 
mysql.default_socket = /var/run/mysqld/mysql.sock and 
mysql.default_socket = /tmp/mysql.sock, but that hasn't helped.


As for /etc/mysql/my.cnf, it says:

- - - - - - - - -
[mysqld]
pid-file= /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysql.sock
- - - - - - - - -

I am unsure where to look to diagnose this problem further.

Any advice would be much appreciated. Thank you.

--
Dave M G

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-15 Thread Kevin Waterson
This one time, at band camp, Dave M G [EMAIL PROTECTED] wrote:
 
 Please understand that I was *hoping* for advice here, as Zend and PHP 
 are surely highly correlated. But I apologize if I came across as if I 
 *expected* answers.

You raise an interesting point. Whilst PHP uses the Zend Engine it is the
only Zend product in use as far as I know. Zend have an array of other
commercial products that are built with PHP, but are no different than
any other commercial venture.

Being that these products are commercial in nature, should not they
be supporting thier own products, rather than relying on the good
will of the open source/PHP folks for tech support? If we should support
Zend products, why not other commercial applications also?
Is Zend hoping for volunteer contributions for commercial enterprises?
Should we support Zend business partners also?


Kind regards
Kevin 

-- 
Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote.

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



Re: [PHP] PAGE TURNED BECOME SOURCE CODE VIEW..

2006-07-15 Thread BBC
 On Sun, July 9, 2006 12:00 pm, BBC wrote:
  Hi list... Thank for answering my questions before. I love to be a
  member of
  this list. Guys... I got another problem with GD library v2. I don't
  know
  why every time the script run the syntax which uses GD, the page
  turned
  becomes source code view. So when we need that page in normal view, we
  had
  to push the 'back button' twice.
 
 Show us the URL to your page, and its source...
 
 We cannot guess from this description what you've managed to do.
Sorry the code I was talking about is in administrator page group, so you need 
to insert username and password to get into it.
I don't think I can give you the username and password through this list. And 
thank for the next input for error_log()..

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



Re: [PHP] Image submit with mouse over

2006-07-15 Thread Stut
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Skip Evans wrote:
 Brand new to the list, so here's my question. I am  implementing a bunch
 of Dreamweaver templates a designer has built into a PHP app, and one
 thing she did is create a submit button (image) that uses mouse over JS:
 
 a href=user.php?req=login target=_top
 onMouseOver=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1)
 onMouseOut=MM_swapImgRestore()img
 src=/theme/images/admin/button_signin.gif alt=Sign In name=signin
 width=86 height=20 border=0/a
 
 But notice this is an href, and it also needs to submit $_POST data
 through a couple of form fields that appear above. So what I tried to do
 in order to be able to retrieve the POST data on the receiving end was
 convert it to the following:
 
 input type=image src=/theme/images/admin/button_signin.gif
 onfocus=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1)
 
 onblur=MM_swapImgRestore()
 
 ...However, the onfocus and onblur are not swapping out the images, as I
 had hoped. (Against all odds, maybe I should add.)

Ok, so you've already had the this is not a JS list reply, so I won't
bother with that, but... Have you ever considered the possibility that
onmouseover and onmouseout work in an input element? Have you tried
looking up the purpose of onfocus and onblur which would have told you
it's not what you need?

This has been your RTFM reply. We hope you enjoyed your PHP-General
experience.

- -Stut
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEuL5n2WdB7L+YMm4RAr0oAJ9idoS/qkUF0oKdFasajKu20kNkTACcC1o6
47vilFoD+XJ99AjT6zA96Bo=
=cWJK
-END PGP SIGNATURE-

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-15 Thread Jochem Maas
Kevin Waterson wrote:
 This one time, at band camp, Dave M G [EMAIL PROTECTED] wrote:
  
 Please understand that I was *hoping* for advice here, as Zend and PHP 
 are surely highly correlated. But I apologize if I came across as if I 
 *expected* answers.
 
 You raise an interesting point. Whilst PHP uses the Zend Engine it is the
 only Zend product in use as far as I know. Zend have an array of other
 commercial products that are built with PHP, but are no different than
 any other commercial venture.
 
 Being that these products are commercial in nature, should not they
 be supporting thier own products, rather than relying on the good
 will of the open source/PHP folks for tech support? If we should support
 Zend products, why not other commercial applications also?
 Is Zend hoping for volunteer contributions for commercial enterprises?
 Should we support Zend business partners also?

just_a_bit_of_silly_humour

yeah ;-) let's take up support of all IBM, Oracle and/or Sun related
problems right away. (actually I remember a thread where John Nichel quipped
we should be supporting anything as long as it was somehow related to IBM -
which is basically anything in the IT world ;-)

and there are probably alot of people on this lsit developing on a Dell
machine - given the problems Dell having been having with their customer
support we should immediately offer all our time to helping Dell customers
with support problems and lets those callcenter workers in India take a
load off. my number is +31 800 ...

anyone having relationship/personal problems should prefix the subject line
of their posts 'php-head-shrink' to ensure a priority response.

I don't think we should draw a line at hotmail support.

/just_a_bit_of_silly_humour
 
 
 Kind regards
 Kevin 
 

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



[PHP] php-head-shrink WAS: Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-15 Thread Paul Scott
--=neXtPaRt_1152981398
Content-Type: text/plain
Content-Transfer-Encoding: 7bit


My IBM laptop and I are having relationship issues...

--Paul


--=neXtPaRt_1152981398
Content-Type: text/plain;

All Email originating from UWC is covered by disclaimer  
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

--=neXtPaRt_1152981398--

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-15 Thread tedd
At 5:05 PM +1000 7/15/06, Kevin Waterson wrote:
This one time, at band camp, Dave M G [EMAIL PROTECTED] wrote:
 
 Please understand that I was *hoping* for advice here, as Zend and PHP
 are surely highly correlated. But I apologize if I came across as if I
 *expected* answers.

You raise an interesting point. Whilst PHP uses the Zend Engine it is the
only Zend product in use as far as I know. Zend have an array of other
commercial products that are built with PHP, but are no different than
any other commercial venture.

Being that these products are commercial in nature, should not they
be supporting thier own products, rather than relying on the good
will of the open source/PHP folks for tech support? If we should support
Zend products, why not other commercial applications also?
Is Zend hoping for volunteer contributions for commercial enterprises?
Should we support Zend business partners also?


Kind regards
Kevin

Kevin:

You raise obvious points, which few would disagree -- we shouldn't be expected 
to be the free support for a commercial product. However, if a php developer 
is looking for other developers who may have had similar experiences with Zend, 
or Apache, or whatever as it relates to php, is this not the forum for those 
types of questions?

Again, just wondering where to draw the line.

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] strange behavior

2006-07-15 Thread jekillen

Hello:
I have a directory on a server that has php code that creates and 
writes to directories as such;  /tiles_.*/.
Each directory with a matching name has graphics files written to it. 
i'm trying to write a script the will
eliminate the graphics files and the directories they are in 
(tiles_.*). The present code is:

?php
function prune()
  {
   $f = 0;
   $pat = 'tiles_.*';
   $view = array();
   $t = array();
   $str = '';
   $start = opendir('.');
   //printHello???br; debug code
   while($lst = readdir($start))
   {
if(ereg($pat, $lst))
  {
   $t[$f] = $lst;
   $str .= $t[$f].'br'; //debug code
  }
 $f++;
}
   rewind($start);
   closedir($start);
   //print $str; debug codethe array $t has all valid 
values at this point.

   for($f = 0; $f  count($t); $f++)
 {$tmp = $t[$f];
  chdir($tmp);
  $dir = opendir($tmp);
  $r = 0;
  while($i = readdir($dir))
   {
@unlink($i);
$r++;
   };
   rewind($dir);
   closedir($dir);
   unset($dir);
   chdir('../');
   rmdir($tmp);
  }

  }
prune();
?
The problem is that each time the for loop tries to chdir to an array 
$t item, errors regarding invalid resources and none existent files are 
generated.
If I use chdir('./'.$tmp) and opendir('./'.$tmp) the code removes all 
the files in the directory the script is located in, including the 
script file itself.
So, I am thinking that, in this case, the directories aren't even 
changed when the @unlink() line is reached and unlink() only sees the 
current
directory files and not included directories, and removes everything 
that isn't a directory.

Here is a sample of the errors generated:
Warning: chdir() [function.chdir]: No such file or directory (errno 2) 
in (path)/prune.php on line 30 // (all resources used based on this are 
invalid)

and;
Warning: opendir(tiles_9215fd05) [function.opendir]: failed to open 
dir: No such file or directory in 
/var/www/html/exp/tile_puzzle/prune.php on line 31
(this happens on the second iteration of the loop..tiles_9215fd05 
is a valid array $t item)
So, Can someone tell me what I might be doing wrong here. I don't want 
to swim around with any more trial and error if possible.

I'm using php 5.1.2, Apache 1.3.34
Thanks in advance.
JK

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



Re: [PHP] strange behavior

2006-07-15 Thread Richard Lynch


$i only has the name of the FILE in it, not the whole path.

You need to provide the full path to unlink() to make this work right.

In theory, you could manage to provide just the relative path from the
current working directory, but, honestly, 99% of the time, a FULL PATH
is just easier to figure out.

On Sun, July 16, 2006 3:46 pm, jekillen wrote:
 Hello:
 I have a directory on a server that has php code that creates and
 writes to directories as such;  /tiles_.*/.
 Each directory with a matching name has graphics files written to it.
 i'm trying to write a script the will
 eliminate the graphics files and the directories they are in
 (tiles_.*). The present code is:
 ?php
 function prune()
{
 $f = 0;
 $pat = 'tiles_.*';
 $view = array();
 $t = array();
 $str = '';
 $start = opendir('.');
 //printHello???br; debug code
 while($lst = readdir($start))
 {
  if(ereg($pat, $lst))
{
 $t[$f] = $lst;
 $str .= $t[$f].'br'; //debug code
}
   $f++;
  }
 rewind($start);
 closedir($start);
 //print $str; debug codethe array $t has all valid
 values at this point.
 for($f = 0; $f  count($t); $f++)
   {$tmp = $t[$f];
chdir($tmp);
$dir = opendir($tmp);
$r = 0;
while($i = readdir($dir))
 {
  @unlink($i);
  $r++;
 };
 rewind($dir);
 closedir($dir);
 unset($dir);
 chdir('../');
 rmdir($tmp);
}

}
 prune();
 ?
 The problem is that each time the for loop tries to chdir to an array
 $t item, errors regarding invalid resources and none existent files
 are
 generated.
 If I use chdir('./'.$tmp) and opendir('./'.$tmp) the code removes all
 the files in the directory the script is located in, including the
 script file itself.
 So, I am thinking that, in this case, the directories aren't even
 changed when the @unlink() line is reached and unlink() only sees the
 current
 directory files and not included directories, and removes everything
 that isn't a directory.
 Here is a sample of the errors generated:
 Warning: chdir() [function.chdir]: No such file or directory (errno 2)
 in (path)/prune.php on line 30 // (all resources used based on this
 are
 invalid)
 and;
 Warning: opendir(tiles_9215fd05) [function.opendir]: failed to open
 dir: No such file or directory in
 /var/www/html/exp/tile_puzzle/prune.php on line 31
 (this happens on the second iteration of the loop..tiles_9215fd05
 is a valid array $t item)
 So, Can someone tell me what I might be doing wrong here. I don't want
 to swim around with any more trial and error if possible.
 I'm using php 5.1.2, Apache 1.3.34
 Thanks in advance.
 JK

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




-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Zend Studio, phpMyAdmin, and mysql.sock

2006-07-15 Thread Richard Lynch
On Sat, July 15, 2006 2:05 am, Kevin Waterson wrote:
 Being that these products are commercial in nature, should not they
 be supporting thier own products, rather than relying on the good
 will of the open source/PHP folks for tech support? If we should
 support
 Zend products, why not other commercial applications also?
 Is Zend hoping for volunteer contributions for commercial enterprises?
 Should we support Zend business partners also?

Zend has provided a great deal to the PHP community -- Zend basically
pays Ze'ev and Andi (and more) to work about half their time on
improving PHP Open Source code.

Zend has NEVER expected the PHP General list to provide free support
for their products.

It is inevitable that some people will turn here if Zend Support lags
for whatever reason, for any definition you choose for lag -- but
you can hardly blame Zend for that.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] GD to database directly

2006-07-15 Thread Richard Lynch
On Fri, July 14, 2006 9:52 pm, Kevin Waterson wrote:


 I'm more concerned about the disaster recovery of a DB from a
 crashed
 hard drive, which has been cluttered up with binary data, making
 data
 recovery.

 One of the greatest benifits of binary DB storage is a single point
 of back up
 mysqldump db_name  backup.sql -u username -p
 It really is as simple as that and no need to bother about referential
 integrity when rebuilding, simple
 mysql db_name  back.sql -u username -p

 How much easier does it get?

Assume, for the sake of argument, that your hard drive crashed.

And your backup tape was invalid.

And the weekly backup tape is also invalid.

And, for good measuere, the monthly tape is just so out-of-date, that
recovering from the crashed hard drive actually looks like an
attractive option.

Your images will make this final last stand not viable.

 Then your field storage size has to be large enough.

 LONGBLOB

Not big enough.

If it *WAS* big enough, we wouldn't have the posts here asking why
their monster image didn't work in their database, and got corrupted.

 Given the number of posts here in PHP-General alone, of people
 getting
 tripped up by these things, I have concluded that cramming images
 into
 the DB is far more trouble than it is worth.

 It *seems* like a Good Idea until you actually do it for awhile, and
 then run into all these snags.

 Oddly enough, I have never run into them. Nor has terraserver which
 stores
 hundreds of thousands of images in its db, although not mysql.

You may well have the needed skill set.

Alas, the sheer number of problem posts here would indicate that that
skillset is not the norm.

I'll stop advising against images in the DB when you answer all the
posts here from the problems it causes. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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