php-general Digest 9 Dec 2002 05:40:32 -0000 Issue 1752

Topics (messages 127437 through 127468):

Re: mysql_connect problem under RedHat 8.0 ?
        127437 by: Tom Rogers
        127438 by: Jason Wong
        127439 by: Brian J. Celenza
        127440 by: Brian J. Celenza

Re: open_basedir
        127441 by: Chris Hewitt

Re: Finding Mode
        127442 by: Paul Chvostek

fopen have a "setTimeout" feature?
        127443 by: Phil Powell
        127451 by: Tim Ward

Can I check MYSQL version
        127444 by: John Taylor-Johnston
        127445 by: Johannes Schlueter
        127446 by: John Taylor-Johnston
        127448 by: Stephen
        127449 by: Chris Knipe

Typo -- Re: [PHP] Can I check MYSQL version
        127447 by: Johannes Schlueter

Hiding URL Variable
        127450 by: Stephen
        127452 by: Tim Ward

Re: Send PHP results in email
        127453 by: Malcolm Brownell

Re: PHP Configuration - Can't Change Post_Max_Size
        127454 by: Malcolm Brownell

Re: Simple text editor for Windows?
        127455 by: John W. Holmes

mpm perchild mod_php4
        127456 by: Jochen Kächelin

Solaris
        127457 by: Kris
        127458 by: Peter Houchin
        127460 by: Kris

date() on two diff. servers
        127459 by: Justin French
        127461 by: John W. Holmes
        127462 by: . Edwin
        127463 by: . Edwin
        127464 by: Justin French
        127465 by: Tom Rogers
        127467 by: . Edwin
        127468 by: Justin French

Re: C#
        127466 by: michael kimsal

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 ---
Hi,

Monday, December 9, 2002, 2:29:35 AM, you wrote:
BJC> Hello!

BJC> When trying to connect to a mysql database under my linux system, I get the
BJC> following error:

BJC> Warning: Can't connect to local MySQL server through socket
BJC> '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2

BJC> Here is a copy of the code I am using:

BJC> <?

BJC>     $link =  mysql_connect("localhos" , "username" , "password")
BJC>             or die("Couldn't Connect.");
BJC>   ?>

BJC> I am currently running Apache with Mysql and PHP version 4 on Redhat 8. Any
BJC> suggestions?

BJC> Thank you.
BJC> --
BJC> ---------------------------------------------------------------
BJC> Brian J. Celenza
BJC> [EMAIL PROTECTED]
BJC> ICQ: 100942424
BJC> AIM: BJCKnight

If that is the location of the socket (mysql default is /tmp/mysql.sock but I
don't know with RH)you could try

$link =  mysql_connect(":/var/lib/mysql/mysql.sock" , "username" , "password")

If that fails, check the permissions of the path to the socket for the apache
user and that mysqld is running.
-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
On Monday 09 December 2002 00:29, Brian J. Celenza wrote:
> Hello!
>
> When trying to connect to a mysql database under my linux system, I get the
> following error:

How did you install your apache, mysql & php? Source/RPM? If RPM, where did 
you get the RPMs? IIRC Redhat's packaging of MySQL differs from that provided 
by www.mysql.com and this difference could potentially cause the problem 
you're seeing ...

> Warning: Can't connect to local MySQL server through socket
> '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2
>
> Here is a copy of the code I am using:
>
> <?
>
>     $link =  mysql_connect("localhos" , "username" , "password")
>             or die("Couldn't Connect.");
>   ?>

... assuming that the above really is a typo and you _are_ using 'localhost' 
and not 'localhos'.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Your business will assume vast proportions.
*/

--- End Message ---
--- Begin Message ---
I'm almost positive that the socket file is in the correct spot.

My installation was with Redhat 8.0, I also have mysqlcc installed, and it
uses /var/lib/mysql/mysql.sock successfully.

----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 08, 2002 11:53 AM
Subject: Re: [PHP] mysql_connect problem under RedHat 8.0 ?


> On Monday 09 December 2002 00:29, Brian J. Celenza wrote:
> > Hello!
> >
> > When trying to connect to a mysql database under my linux system, I get
the
> > following error:
>
> How did you install your apache, mysql & php? Source/RPM? If RPM, where
did
> you get the RPMs? IIRC Redhat's packaging of MySQL differs from that
provided
> by www.mysql.com and this difference could potentially cause the problem
> you're seeing ...
>
> > Warning: Can't connect to local MySQL server through socket
> > '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2
> >
> > Here is a copy of the code I am using:
> >
> > <?
> >
> >     $link =  mysql_connect("localhos" , "username" , "password")
> >             or die("Couldn't Connect.");
> >   ?>
>
> ... assuming that the above really is a typo and you _are_ using
'localhost'
> and not 'localhos'.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Your business will assume vast proportions.
> */
>

--- End Message ---
--- Begin Message ---
Found the problem...

Somehow my version of mysql had become uninstalled, and I have no idea why
that is. Thanks for all the help :)


"Brian J. Celenza" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello!
>
> When trying to connect to a mysql database under my linux system, I get
the
> following error:
>
> Warning: Can't connect to local MySQL server through socket
> '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2
>
> Here is a copy of the code I am using:
>
> <?
>
>     $link =  mysql_connect("localhos" , "username" , "password")
>             or die("Couldn't Connect.");
>   ?>
>
> I am currently running Apache with Mysql and PHP version 4 on Redhat 8.
Any
> suggestions?
>
> Thank you.
> --
> ---------------------------------------------------------------
> Brian J. Celenza
> [EMAIL PROTECTED]
> ICQ: 100942424
> AIM: BJCKnight
>
>


--- End Message ---
--- Begin Message ---
Przemysław Żółczyński PRV wrote:

When I am try toput photo to the server I get this:

Warning: open_basedir restriction in effect. File is in wrong directory in
/mnt/host-users/zolty/tools/addprod.php on line 117

What is this?

Przemek

open_basedir restricts the directories that may be used. The message is telling you that the file you are trying to use is outside the directories allowed by open_basedir. Check the manual for more details.

HTH
Chris



--- End Message ---
--- Begin Message ---
On Sat, Dec 07, 2002 at 07:12:09PM -0500, Stephen wrote:
>
> Another math question... How would I find the mode (number that repeats most
> often) of an array? Then, if there isn't a number that repeats most often,
> tell the user that.

A while back, I wrote functions for mean, median and mode.  I've put
them up at http://www.it.ca/software/statsmmm.php .  I don't much like
the mode function -- it seems awkward, but I couldn't figure out how to
write it any smaller.

Also included is a function that calculates the 95th percentile of
values in an array, roughly the same way the median() function works ...
but I don't recommend using this for bandwidth calculations for co-lo
customers because of the hassle of pulling all that data into an array.
95th percentile is more easily calculated in the SQL server than in php.

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever                          +1 416 598-0000
  it.canada - hosting and development                  http://www.it.ca/

--- End Message ---
--- Begin Message ---
Can you set something like a "setTimeout" feature in fopen? That is, if you use fopen 
to open a URL for "scraping", if that URL's server is down or doesn't respond in x 
seconds, can you set a feature to show an error message or a "friendly" error message 
indicating such?

Thanx
Phil
--- End Message ---
--- Begin Message ---
how about something like...

$start = time();
$timeout = 60; // number of seconds to try
while (!$file = fopen("...") && time() < $start + $timeout);
if ($file)
{   // do stuff with file
}

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
----- Original Message -----
From: Phil Powell <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, December 08, 2002 7:32 PM
Subject: [PHP] fopen have a "setTimeout" feature?


Can you set something like a "setTimeout" feature in fopen? That is, if you
use fopen to open a URL for "scraping", if that URL's server is down or
doesn't respond in x seconds, can you set a feature to show an error message
or a "friendly" error message indicating such?

Thanx
Phil


--- End Message ---
--- Begin Message ---
Hi,
Can I check mysql version so if version >= 4 $sql = 'version 4 stuff' else $sql 
="version 3 stuff";

--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not open-source, it's Murphy's Law."

   -     Université de Sherbrooke:
          http://compcanlit.ca/

--- End Message ---
--- Begin Message ---
On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote:
> Hi,
> Can I check mysql version so if version >= 4 $sql = 'version 4 stuff' else
> $sql ="version 3 stuff";

Try this SQL-Statement:

SEELCT VERSION();

MySQL-Manual: http://www.mysql.com/doc/en/Miscellaneous_functions.html

johannes

--- End Message ---
--- Begin Message ---
mysql> SELECT VERSION();
             -> '3.23.13-log'

Ok, how do I PHP it for greater than or equals version 4 :?

John

Johannes Schlueter wrote:

> On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote:
> > Hi,
> > Can I check mysql version so if version >= 4 $sql = 'version 4 stuff' else
> > $sql ="version 3 stuff";
>
> Try this SQL-Statement:
>
> SEELCT VERSION();
>
> MySQL-Manual: http://www.mysql.com/doc/en/Miscellaneous_functions.html
>
> johannes

--- End Message ---
--- Begin Message ---
$sql = "SELECT VERSION()";
$result = mysql_query($sql);
$ver = mysql_fetch_assoc($result);

if($ver[0] >= 4)
{
    echo "You have MySQL 4.0 or greater";
}
else
{
    echo "You DON'T have MySQL 4.0 or greater";
}

Not sure if that'll work or not, I haven't tested it. Hope it does though.


----- Original Message -----
From: "John Taylor-Johnston" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 08, 2002 2:57 PM
Subject: Re: [PHP] Can I check MYSQL version


> mysql> SELECT VERSION();
>              -> '3.23.13-log'
>
> Ok, how do I PHP it for greater than or equals version 4 :?
>
> John
>
> Johannes Schlueter wrote:
>
> > On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote:
> > > Hi,
> > > Can I check mysql version so if version >= 4 $sql = 'version 4 stuff'
else
> > > $sql ="version 3 stuff";
> >
> > Try this SQL-Statement:
> >
> > SEELCT VERSION();
> >
> > MySQL-Manual: http://www.mysql.com/doc/en/Miscellaneous_functions.html
> >
> > johannes
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
oh gawd... get the spoons...

$query = mysql_query("select version as version")
while ($result = mysql_fetch_row($query)) {
//  do a strcmp() or ereg() on $row['0']
}


----- Original Message -----
From: "John Taylor-Johnston" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 08, 2002 9:57 PM
Subject: Re: [PHP] Can I check MYSQL version


> mysql> SELECT VERSION();
>              -> '3.23.13-log'
>
> Ok, how do I PHP it for greater than or equals version 4 :?
>
> John
>
> Johannes Schlueter wrote:
>
> > On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote:
> > > Hi,
> > > Can I check mysql version so if version >= 4 $sql = 'version 4 stuff'
else
> > > $sql ="version 3 stuff";
> >
> > Try this SQL-Statement:
> >
> > SEELCT VERSION();
> >
> > MySQL-Manual: http://www.mysql.com/doc/en/Miscellaneous_functions.html
> >
> > johannes
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
On Sunday 08 December 2002 20:40, Johannes Schlueter wrote:
> SEELCT VERSION();

Should be SELECT VERSION() 

;-)

johannes
--- End Message ---
--- Begin Message ---
How can you hide URL variables without using the POST method in a form?

Thanks,
Stephen Craton
http://www.melchior.us

"What is a dreamer that cannot persevere?" -- http://www.melchior.us
--- End Message ---
--- Begin Message ---
store them in a session or cookie

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
----- Original Message -----
From: Stephen <[EMAIL PROTECTED]>
To: PHP List <[EMAIL PROTECTED]>
Sent: Sunday, December 08, 2002 8:10 PM
Subject: [PHP] Hiding URL Variable


> How can you hide URL variables without using the POST method in a form?
>
> Thanks,
> Stephen Craton
> http://www.melchior.us
>
> "What is a dreamer that cannot persevere?" -- http://www.melchior.us
>


----------------------------------------------------------------------------
----


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

--- End Message ---
--- Begin Message ---
Thanks Jason,
  I saw this a while ago and it solved the  problem perfectly.


On Thu, 5 Dec 2002 06:11:40 +0800, [EMAIL PROTECTED] (Jason Wong) wrote:
> On Thursday 05 December 2002 05:58, Malcolm Brownell wrote:
> > Hi,
> >
> >   I have some database fields I want to select and email.
> >
> > I have lines like   --
> >
> >  $result = mysql_query("SELECT * FROM adopt_main order by idform desc limit
> > 1"); while( $row = mysql_fetch_array ($result))
> >     echo "".$row["first"].",";
> >
> >
> > There are quite a few of these paragraphs in the page  -- 15 fields.  The
> > page does just what I want.  It echos the value, with commas and quotes,
> > all ready to be inserted, but, I can'tseem to figure out how to mail it.  I
> > know I need to make all of this a variable to pass to my mail script, but
> > how ?  My mail script work fine if I define $body and send that but I can't
> > seem to do that with this code.
> 
> In your while loop, instead of (or as well as) using echo, assign your values 
> to $body
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> 
> /*
> If something has not yet gone wrong then it would ultimately have been
> beneficial for it to go wrong.
> */
> 



--- End Message ---
--- Begin Message ---
I've got 4.1.1 and it's
upload_max_filesize    mine is default 2 M

maybe you have a different version.

hth

m



On Thu, 5 Dec 2002 10:32:44 -0800, [EMAIL PROTECTED] (Roger Lewis) wrote:
> This is further to my post yesterday on Max File Size.
> 
> I was able to set upload_max_filesize to 7900000 and I can therefore upload
> files up to that size.  I would now like to increase that limit, but I am
> limited by post_max_size which defaults to 8M.  I can't seem to change the
> value of post_max_size.
> 
> The post_max_size directive is not in my php.ini; however, I tried inserting
> it into php.ini and setting it to 16000000 and to 16M.   I inserted it just
> before the directive, gpc_order  = "GPC".  The change is ignored by
> phpinfo(), that is, phpinfo() still shows post_max_size = 8M.
> 
> Furthermore, I tried resetting it using ini_set("post_max_size", "16M"), and
> ini_set("post_max_size", "16000000"), but neither of these had any effect.
> 
> Any suggestion for how I might reset post_max_size.  I'm using PHP 4.0.6.
> 
> Thanks in advance.
> 
> Roger
> 
> 
> 



--- End Message ---
--- Begin Message ---
As a followup, I know someone mentioned Crimson Editor for my question.
It installed fine on WinXP as a general user, but it wanted to access
the registry and wouldn't install as a general user under Win2K. FYI...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -----Original Message-----
> From: Jonathan [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, December 07, 2002 3:19 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Re[4]: [PHP] Simple text editor for Windows?
> 
> Try Winsyntax (http://winsyntax.com/)
> 
> It's not as robust and colorful as others, but it's simplicity has won
> me over.
> 
> It's great is you just want to code.
> 
> -----Original Message-----
> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, December 07, 2002 12:51 PM
> To: DL Neil
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re[4]: [PHP] Simple text editor for Windows?
> 
> Hi,
> 
> Sunday, December 8, 2002, 4:22:52 AM, you wrote:
> DN> Hi Tom,
> 
> >> >> I know the text editor question has been beat to death, but I'm
> looking
> >> >> for a simple editor with syntax highlighting that can be
installed
> in
> >> >> Windows by a general user. It would have to be something that
> didn't
> >> >> access the registry, as normal users can't do that. Does anyone
> know of
> >> >> a program like this? Thanks.
> >>
> >> Take a look at this one it seemed to be pretty good, the closest
I've
> seen
> DN> to
> >> homesite functionality without the bloat.
> >> http://www.crimsoneditor.com/
> 
> 
> DN> Looks interesting - and no registry finagling you say!
> DN> One expects that John meant PHP syntax highlighting. From where is
> the PHP
> DN> control file made available?
> 
> DN> Please advise,
> DN> =dn
> 
> 
> >From the same site
> http://www.crimsoneditor.com/board/data/user0/php.zip
> 
> --
> regards,
> Tom
> 
> 
> --
> 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


--- End Message ---
--- Begin Message ---
I ask this list now because nobody could answer my question on the apache list.
I installed Apache 2.0.43 --with-mpm=perchild in order to get more
security in executing php-scripts. I know that perchild is
experimental but I couldn't run it at all. We will make some tests -
without success.


When I try to connect with http://192.168.0.1
I will get no answers (browser ist loading, loading, loading....


httpd.conf:

Listen 80
ServerAdmin [EMAIL PROTECTED]
ServerName 192.168.0.1:80
NameVirtualHost 192.168.0.1
Include /etc/apache/virtual.conf


virtual.conf:

<VirtualHost 192.168.0.1>
        Servername 192.168.0.1
        ServerAdmin [EMAIL PROTECTED]
        DocumentRoot /www
#       AssignUserid nobody nobody
        ChildPerUserId jochen jochen 2
</VirtualHost>

What should I insert into AssignUserId?
Apache ist running as

user: nobody
group: nobody.

ps aux:

root     20015  0.0  1.5  3600 2024 ?        S    16:01   0:00 
/usr/local/apache2/bin/httpd -k start
nobody   20016  0.0  1.5  3536 1964 ?        S    16:01   0:00 
/usr/local/apache2/bin/httpd -k start
nobody   23779  0.0  1.7 13916 2160 ?        S    16:05   0:00 
/usr/local/apache2/bin/httpd -k start
nobody   23781  0.0  1.7 13916 2160 ?        S    16:05   0:00 
/usr/local/apache2/bin/httpd -k start
nobody   23788  0.0  0.0     0    0 ?        Z    16:05   0:00 [httpd <defunct>]
nobody   23789  0.0  1.7 13916 2160 ?        S    16:05   0:00 
/usr/local/apache2/bin/httpd -k start
nobody   23790  0.0  1.7 13916 2160 ?        S    16:05   0:00 
/usr/local/apache2/bin/httpd -k start
nobody   23791  0.0  0.0     0    0 ?        Z    16:05   0:00 [httpd <defunct>]
jochen   24161  0.0  0.0     0    0 ?        Z    16:05   0:00 [httpd <defunct>]
nobody   24162  0.0  0.0     0    0 ?        Z    16:05   0:00 [httpd <defunct>]

error_log:

[Sun Dec 08 16:03:03 2002] [notice] child pid 21526 exit signal Segmentation fault (11)
[Sun Dec 08 16:03:03 2002] [notice] child pid 21524 exit signal Segmentation fault (11)
[Sun Dec 08 16:03:03 2002] [emerg] (13)Permission denied: apr_proc_mutex_lock failed. 
Attempting to shutdown process
gracefully.
[Sun Dec 08 16:03:03 2002] [emerg] (13)Permission denied: apr_proc_mutex_unlock 
failed. Attempting to shutdown process
gracefully.
[Sun Dec 08 16:03:03 2002] [emerg] (13)Permission denied: apr_proc_mutex_lock failed. 
Attempting to shutdown process
gracefully.
[Sun Dec 08 16:03:03 2002] [emerg] (13)Permission denied: apr_proc_mutex_unlock 
failed. Attempting to shutdown process
gracefully.

-- 
Jochen Kaechelin

--- End Message ---
--- Begin Message ---
Sorry I know this is off subject but I'm in a bind.

I have a problem with my Solaris box booting up.
Does I fairly new to all of this so does anybody know a good newsgroup for Solaris??

My problem is I added a file so a program would auto load. I added the file to 
etc/rc2.d
Now this program loads perfect but continues to run and the rest of the O/S can't load.
How can I access that director to delete the file??

Thanks for any help....

Kris

--- End Message ---
--- Begin Message ---
Kris,

a couple of options for you to try are http://www.sun.com/bigadmin
http://www.solariscentral.com also have a search in google

also you can try this... resart the machine and press stop a after the
banner comes up and you get the "ok" prompt .. then type boot -s (for single
user mode) (you will need to know the root password) it will come up with a
message saying something like .. you are about to enter into maintance
mode.. press control-c to proceed in normal start up mode.

once you have entered in the root password you will be able to mode around
the directories via the command line .. then is a simple matter of tying cd
/etc/rc2.d ; rm <filename>

> -----Original Message-----
> From: Kris [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 9 December 2002 12:04 PM
> To: PHP List
> Subject: [PHP] Solaris
>
>
> Sorry I know this is off subject but I'm in a bind.
>
> I have a problem with my Solaris box booting up.
> Does I fairly new to all of this so does anybody know a good
> newsgroup for Solaris??
>
> My problem is I added a file so a program would auto load. I
> added the file to etc/rc2.d
> Now this program loads perfect but continues to run and the rest
> of the O/S can't load.
> How can I access that director to delete the file??
>
> Thanks for any help....
>
> Kris
>
>

--- End Message ---
--- Begin Message ---
Thank you so much

Worked like a charm!! :)

Kris

----- Original Message -----
From: "Peter Houchin" <[EMAIL PROTECTED]>
To: "Kris" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, December 09, 2002 12:01 PM
Subject: RE: [PHP] Solaris


> Kris,
>
> a couple of options for you to try are http://www.sun.com/bigadmin
> http://www.solariscentral.com also have a search in google
>
> also you can try this... resart the machine and press stop a after the
> banner comes up and you get the "ok" prompt .. then type boot -s (for
single
> user mode) (you will need to know the root password) it will come up with
a
> message saying something like .. you are about to enter into maintance
> mode.. press control-c to proceed in normal start up mode.
>
> once you have entered in the root password you will be able to mode around
> the directories via the command line .. then is a simple matter of tying
cd
> /etc/rc2.d ; rm <filename>
>
> > -----Original Message-----
> > From: Kris [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, 9 December 2002 12:04 PM
> > To: PHP List
> > Subject: [PHP] Solaris
> >
> >
> > Sorry I know this is off subject but I'm in a bind.
> >
> > I have a problem with my Solaris box booting up.
> > Does I fairly new to all of this so does anybody know a good
> > newsgroup for Solaris??
> >
> > My problem is I added a file so a program would auto load. I
> > added the file to etc/rc2.d
> > Now this program loads perfect but continues to run and the rest
> > of the O/S can't load.
> > How can I access that director to delete the file??
> >
> > Thanks for any help....
> >
> > Kris
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi,

I'm running the following code on two servers:

<?
$stamp = 1039525200;
echo date('D, d M Y',$stamp);
?>

On my local development box (Free BSD, PHP 4.1.1, on AUSTRALIAN time), the
above echo's "Wed, 11 Dec 2002" (I consider this to be the "correct date".

However on the live server (Red Hat, PHP 4.2.3, hosted in CANADA) the above
code echo's "Tue, 10 Dec 2002".


Now, what could be causing this problem?  IMHO, no matter where you are in
the world (or more to the point, what timezone you are in), 1039525200
seconds after a certain date (in this case the unix epoch) should be another
certain date, yes?


What could be causing this difference?  What should I talk to my host about,
or look for?



Thanks,

Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
Daylight Savings Time?

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -----Original Message-----
> From: Justin French [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, December 08, 2002 8:59 PM
> To: php
> Subject: [PHP] date() on two diff. servers
> 
> Hi,
> 
> I'm running the following code on two servers:
> 
> <?
> $stamp = 1039525200;
> echo date('D, d M Y',$stamp);
> ?>
> 
> On my local development box (Free BSD, PHP 4.1.1, on AUSTRALIAN time),
the
> above echo's "Wed, 11 Dec 2002" (I consider this to be the "correct
date".
> 
> However on the live server (Red Hat, PHP 4.2.3, hosted in CANADA) the
> above
> code echo's "Tue, 10 Dec 2002".
> 
> 
> Now, what could be causing this problem?  IMHO, no matter where you
are in
> the world (or more to the point, what timezone you are in), 1039525200
> seconds after a certain date (in this case the unix epoch) should be
> another
> certain date, yes?
> 
> 
> What could be causing this difference?  What should I talk to my host
> about,
> or look for?
> 
> 
> 
> Thanks,
> 
> Justin French
> --------------------
> http://Indent.com.au
> Web Development &
> Graphic Design
> --------------------
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
Hello,

"John W. Holmes" <[EMAIL PROTECTED]> wrote:

> Daylight Savings Time?

John, I think "Daylight Saving Time" creates a difference of 1 hour and not
1 day :)

Anyway, I live in a place where we don't practice this so I could be
wrong...

...[snip]...

> > Now, what could be causing this problem?  IMHO, no matter where you
> are in
> > the world (or more to the point, what timezone you are in), 1039525200
> > seconds after a certain date (in this case the unix epoch) should be
> > another
> > certain date, yes?

Justin, it depends how you got your "timestamp" in the first place, I
think...

I could be wrong again here but aren't these different?

  mktime()
  gmmktime()

- E

...[snip]...
--- End Message ---
--- Begin Message ---
But, then again, it could be just because the other server's time is really
late... (caused by old motherboard batteries, etc.)

- E

"@ Edwin" <[EMAIL PROTECTED]> wrote:

> Hello,
>
> "John W. Holmes" <[EMAIL PROTECTED]> wrote:
>
> > Daylight Savings Time?
>
> John, I think "Daylight Saving Time" creates a difference of 1 hour and
not
> 1 day :)
>
> Anyway, I live in a place where we don't practice this so I could be
> wrong...
>
> ...[snip]...
>
> > > Now, what could be causing this problem?  IMHO, no matter where you
> > are in
> > > the world (or more to the point, what timezone you are in), 1039525200
> > > seconds after a certain date (in this case the unix epoch) should be
> > > another
> > > certain date, yes?
>
> Justin, it depends how you got your "timestamp" in the first place, I
> think...
>
> I could be wrong again here but aren't these different?
>
>   mktime()
>   gmmktime()
>
> - E
>
> ...[snip]...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
on 09/12/02 1:30 PM, @ Edwin ([EMAIL PROTECTED]) wrote:

>> Daylight Savings Time?
> 
> John, I think "Daylight Saving Time" creates a difference of 1 hour and not
> 1 day :)

True... but I checked it anyway -- by adding just one and two hours to the
stamp... which made no difference... but when I added 86400 to the stamp, it
all worked.


> Justin, it depends how you got your "timestamp" in the first place, I
> think...
> 
> I could be wrong again here but aren't these different?
> 
> mktime()
> gmmktime()

Actually, they were created with strtotime().  Note, I don't believe there's
anything wrong with the stamp itself.  The point is, the stamp is displaying
as two different dates using date() on two different servers, and I believe
this is not what date() is supposed to do.

Shouldn't the stamp for 12-09-2002 22:13:09 be the same on every server?

My rationale for this is that no matter where you are in the world, it is
always a certain number of seconds since 01-01-1970 00:00:00.

Perhaps strtotime() is NOT running off GMT, and perhaps date() is... there
has to be SOME confusion there -- either on my side, or in my choice of
functions, or SOMETHING :)


Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
Hi,

Monday, December 9, 2002, 11:59:07 AM, you wrote:
JF> Hi,

JF> I'm running the following code on two servers:

JF> <?
JF> $stamp = 1039525200;
JF> echo date('D, d M Y',$stamp);
?>>

JF> On my local development box (Free BSD, PHP 4.1.1, on AUSTRALIAN time), the
JF> above echo's "Wed, 11 Dec 2002" (I consider this to be the "correct date".

JF> However on the live server (Red Hat, PHP 4.2.3, hosted in CANADA) the above
JF> code echo's "Tue, 10 Dec 2002".


JF> Now, what could be causing this problem?  IMHO, no matter where you are in
JF> the world (or more to the point, what timezone you are in), 1039525200
JF> seconds after a certain date (in this case the unix epoch) should be another
JF> certain date, yes?


JF> What could be causing this difference?  What should I talk to my host about,
JF> or look for?



JF> Thanks,

JF> Justin French
JF> --------------------
JF> http://Indent.com.au
JF> Web Development & 
JF> Graphic Design
JF> --------------------

Put this at the top of your page

$tz = getenv('TZ');
if($tz != 'Australia/Brisbane') putenv("TZ=Australia/Brisbane");

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
"Justin French" <[EMAIL PROTECTED]> wrote:

[snip]
> Perhaps strtotime() is NOT running off GMT, 
[/snip]

Bingo!

...or, Bull's eye!, whatever :)

Anyway, I think this is "implied" in the manual.

  http://www.php.net/manual/en/function.strtotime.php

Also, check "User Contributed Notes":

  piran at pobox dot com
  php at webdevelopers dot cz

HTH,

- E

--- End Message ---
--- Begin Message ---
on 09/12/02 3:06 PM, @ Edwin ([EMAIL PROTECTED]) wrote:

> [snip]
>> Perhaps strtotime() is NOT running off GMT,
> [/snip]
> 
> Bingo!

*GULP*... so, what we're saying is, that if I intend to pass data around on
multiple servers (in different timezones) using a unix timestamp for dates
(which i prefer to do), I should be using gmdate() and gmmktime() rather
than date() and strtotime()?

That will sure as hell be a few lines of code to dig through!!!!

I'll also need an accurate (and daylight savings compliant!) way of
determining the how far ahead of the GMT the server currently is, or for a
specific timezone for a specific project (eg this current one, which is
basing it's dates on Sydney, Australia.



Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
Wilmar Perez wrote:
Hello guys

I'm sorry if this message disturbs anyone, I know it is completely off topic.

I've been thinking about open a C# mailing list for I hadn't been able to find a good one so far. All I want to know is if there is enough people out there interested in joining such list.
I posted this message to this list for a couple of reason: it is the only programming list I am in and since you're php developers I thought many of you may be interested.

Again please don't get mad at me for this I don't mean to upset or disturb anyone.


Sr. Perez:

Please visit aspfriends.com (I think that's it) or learnasp.com.   There
are links there to many c# and other .net-related lists and boards.

Good luck.

Michael Kimsal
http://www.phpappserver.com
734-480-9961

--- End Message ---

Reply via email to