php-general Digest 8 Aug 2004 20:20:23 -0000 Issue 2925
Topics (messages 193120 through 193140):
Re: Local version works - production breaks
193120 by: Jason Wong
193126 by: Torsten Roehr
193134 by: Andre Dubuc
Re: safe_mode restriction
193121 by: Jason Wong
193128 by: Kevin
Re: annoying autoreplies
193122 by: Chris Martin
193123 by: Bjorn Sodergren
Re: SQL Join query
193124 by: Lenar L�hmus
193135 by: Curt Zirzow
Re: Function Mail
193125 by: Torsten Roehr
193136 by: John Holmes
WYSIWyG
193127 by: Me2resh
193132 by: raditha dissanayake
193138 by: Matthew Sims
php_check_syntax loads functions and classes
193129 by: Michael Scholl
193137 by: John Holmes
193139 by: John Holmes
Bouncer Test
193130 by: Aidan Lister
PHP and Apache 2
193131 by: Rosen
193133 by: Aidan Lister
Re: php source management
193140 by: Jordi Canals
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 ---
On Sunday 08 August 2004 09:38, Andre Dubuc wrote:
> That's what I thought. But the differences are glaring. Seems like none of
> the code wants to work. Navigation is a nightmare: header("location:...");
> usually brings an error message: function so and so -- include("xxx.php");
> has already been declared -- cannot redeclare (yet locally - absolutely no
> problem!) ??
IIRC older versions of PHP allowed multiple declarations of a function.
Somewhere along the line this was changed.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
God isn't dead. He just doesn't want to get involved.
*/
--- End Message ---
--- Begin Message ---
> Robby,
>
> I just enabled log_errors locally. No errors (as I thought).
>
> Since I am hacking a previously written site, the problem seems to arise
most
> when accessing his pre-built functions across pages. For instance, he uses
a
> 'cards.php' to store all display functions -- showleft() -- showcentre() ,
as
> well as the connect() function.
Hi Andre,
make sure to use require_once for all includes. This will make sure to only
include each file once and will trigger a fatal error if the file cannot be
found because of a wrong path or whatever.
Hope this helps, Torsten Roehr
> Since its a persistent connection -- he opens
> the db once, then performs various queries in it. However, since
'cards.php'
> has already been called once by a page that might require both showleft()
and
> showcentre() -- it barfs and says that it cannot 'redeclare' the
showleft()
> function that has already been declared?? That is really some weird --
> particularly when it works so well (as expected) locally - and also since
I'm
> not 'redeclaring' but calling it for use!
>
> I cannot fathom why the production site would give this error. Perhaps I
need
> to do absolute paths for all headers? But it doesn't make sense that a
> function cannot be called many times -- declaring it once, yes, but
calling
> its use?? If that were the case, then one might as well write it out
longhand
> for each use, and forget the concept of 'functions'.
>
> I think I should look at the error logs for the site -- maybe they will
clue
> me in where I should look.
>
> Thanks,
> Andre
--- End Message ---
--- Begin Message ---
Thanks for the idea, Josh.
I will do this, but still this hack doesn't answer the question: "Why does it
work locally without hitch, yet totally barfs on a very similar configuration
on the net?"
As I mentioned, this is a re-write. I've learned my lesson: never try to patch
another's code -- write it fresh! There is simply way too much weird behavior
happening with the present code: sessions not passing, odd error messages
about redeclaration, and conditionals where both are passed.
Time to dump it and start fresh!
Thanks (to everyone) for your help and pointers!
Andre
On Sunday 08 August 2004 09:19 am, Josh Acecool M wrote:
> Try adding
> if (!function_exists("function_name")) {
> function function_name ($blah) {
> // Function Code
> }
> }
> for each function.
>
> That will fix the redeclare problem which happens if you call your
> cards.php file in more than 1 file..
>
> "Andre Dubuc" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > On Saturday 07 August 2004 10:11 pm, Robby Russell wrote:
> > > On Sat, 2004-08-07 at 19:00, Ed Lazor wrote:
> > > > It could be that you have local error reporting set to none. It
> > > > could also be that you're using full paths when referencing files
> > > > which then breaks when moving files to a new server. Basically,
> > > > there's a lot of possibilities and I'm not going to have much luck
> > > > helping unless you include error messages. My guess is that
> > > > resolving a few errors will address a core problem and everything
> > > > will start working.
> > > >
> > > > -Ed
> > >
> > > Yes, it's very possible that he isn't getting errors locally because
> > > his errors aren't on.
> > >
> > > Andre,
> > >
> > > You might check your error settings on your local server. You might
> > > even consider upgrading php on your local server to the same version
> > > and debugging.
> > >
> > > -Robby
> > >
> > > --
> > > /***************************************
> > > * Robby Russell | Owner.Developer.Geek
> > > * PLANET ARGON | www.planetargon.com
> > > * Portland, OR | [EMAIL PROTECTED]
> > > * 503.351.4730 | blog.planetargon.com
> > > * PHP/PostgreSQL Hosting & Development
> > > ****************************************/
> >
> > Robby,
> >
> > I just enabled log_errors locally. No errors (as I thought).
> >
> > Since I am hacking a previously written site, the problem seems to arise
>
> most
>
> > when accessing his pre-built functions across pages. For instance, he
> > uses
>
> a
>
> > 'cards.php' to store all display functions -- showleft() -- showcentre()
> > ,
>
> as
>
> > well as the connect() function. Since its a persistent connection -- he
>
> opens
>
> > the db once, then performs various queries in it. However, since
>
> 'cards.php'
>
> > has already been called once by a page that might require both showleft()
>
> and
>
> > showcentre() -- it barfs and says that it cannot 'redeclare' the
>
> showleft()
>
> > function that has already been declared?? That is really some weird --
> > particularly when it works so well (as expected) locally - and also since
>
> I'm
>
> > not 'redeclaring' but calling it for use!
> >
> > I cannot fathom why the production site would give this error. Perhaps I
>
> need
>
> > to do absolute paths for all headers? But it doesn't make sense that a
> > function cannot be called many times -- declaring it once, yes, but
>
> calling
>
> > its use?? If that were the case, then one might as well write it out
>
> longhand
>
> > for each use, and forget the concept of 'functions'.
> >
> > I think I should look at the error logs for the site -- maybe they will
>
> clue
>
> > me in where I should look.
> >
> > Thanks,
> > Andre
--- End Message ---
--- Begin Message ---
On Sunday 08 August 2004 12:00, Kevin wrote:
Please do not top post.
> Permissions are set to 0777.
So after the directories are created, those are the actual permissions that
are on them? Did you actually check this or are you assuming it? If you can,
please show us the output of 'ls -al' of the directories in question.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
A man always needs to remember one thing about a beautiful woman.
Somewhere, somebody's tired of her.
*/
--- End Message ---
--- Begin Message ---
> So after the directories are created, those are the actual permissions
that
> are on them? Did you actually check this or are you assuming it? If you
can,
> please show us the output of 'ls -al' of the directories in question.
Yes, I have seen the permission and its rwx-rwx-rwx i.e 777.
--- End Message ---
--- Begin Message ---
Robby Russell wrote:
To all those who have auto-replys set for their email, please turn them
off. ;-)
We shouldn't have to opt-in to 3 different peoples spam email sites so
that we can post to the list. heh.
-Robby
Seriously, we shouldn't have to setup a new mail filter everytime we
reply either!
At least they're not on PDXLUG!!!
--
Chris Martin
Web Developer
Open Source & Web Standards Advocate
http://www.chriscodes.com/
--- End Message ---
--- Begin Message ---
heh, i subscribe to a couple mailing lists for a product that i work
with (a rather large company). last month i got a record 43 "out of
office " replies from a single message to their list.
On Sat, 07 Aug 2004 23:37:27 -0700, Chris Martin <[EMAIL PROTECTED]> wrote:
> Robby Russell wrote:
> > To all those who have auto-replys set for their email, please turn them
> > off. ;-)
> >
> > We shouldn't have to opt-in to 3 different peoples spam email sites so
> > that we can post to the list. heh.
> >
> > -Robby
> >
>
> Seriously, we shouldn't have to setup a new mail filter everytime we
> reply either!
>
> At least they're not on PDXLUG!!!
>
> --
> Chris Martin
> Web Developer
> Open Source & Web Standards Advocate
> http://www.chriscodes.com/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Mattias Thorslund wrote:
> Though, (regardless of SQL database platform) in a case like this, it
> MAY be both more straightforward and efficient to use two separate
> queries for the pictures and comments, given the one-to-many cardinality
> between them. The above statement causes redundant data to be returned
> - it duplicates the pics record for each new comment. If there are many
> large columns in the pics table and many comments to each record there's
> a lot of redundant data in a query like that.
No, I think you are wrong. There was GROUP BY pics.id so it won't return
duplicate data. And probable overhead is eliminated too I think - DBserver
will optimize and will join data from pic_comments only once for each
unique pics.id.
Lenar
--- End Message ---
--- Begin Message ---
* Thus wrote Lenar Lhmus:
> Mattias Thorslund wrote:
>
> > Though, (regardless of SQL database platform) in a case like this, it
> > MAY be both more straightforward and efficient to use two separate
> > queries for the pictures and comments, given the one-to-many cardinality
> > between them. The above statement causes redundant data to be returned
> > - it duplicates the pics record for each new comment. If there are many
> > large columns in the pics table and many comments to each record there's
> > a lot of redundant data in a query like that.
>
> No, I think you are wrong. There was GROUP BY pics.id so it won't return
> duplicate data. And probable overhead is eliminated too I think - DBserver
> will optimize and will join data from pic_comments only once for each
> unique pics.id.
The results will be something like:
id submitter count pic_id comment
1 joe 4 1 comment1
1 joe 4 1 comment2
1 joe 4 1 comment3
1 joe 4 1 comment4
2 john 0 2 NULL
3 jim 5 3 comment6
3 jim 5 3 comment7
3 jim 5 3 comment8
3 jim 5 3 comment9
3 jim 5 3 comment10
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
--- End Message ---
--- Begin Message ---
"Juan Pablo Herrera" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi everybody,
> I have a cuestion about the features on function mail. I think that it
> send the email one to one address. Is it ok?.
> Regards,
> Juan Pablo
Hi Juan Pablo,
the manual says:
"mail() automatically mails the message specified in message to the receiver
specified in to . Multiple recipients can be specified by putting a comma
between each address in to."
This should answer your question. Otherwise take a look at the manual page:
http://de2.php.net/manual/en/function.mail.php
Regards, Torsten Roehr
--- End Message ---
--- Begin Message ---
Juan Pablo Herrera wrote:
I have a cuestion about the features on function mail. I think that it
send the email one to one address. Is it ok?.
Yes. It is all ok.
--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--- End Message ---
--- Begin Message ---
|
Hi
i am using WYSIWYG (_javascript_ editor) to enter the contents of online news website ,(PHP & MYSQL)
everything works pretty good on my local server
but online
when i enter a page
i find that the colors i choosed changed
would this be a problem on my code or on something on the server or the _javascript_
i didn't know what part of my code to include here
so can anyone tell me where is the problem ?
code is available for discuss
|
____________________________________________________
IncrediMail - Email has finally evolved - Click Here |
--- End Message ---
--- Begin Message ---
Please read the list newbie guide
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--- End Message ---
--- Begin Message ---
> Hi
> i am using WYSIWYG (javascript editor) to enter the contents of online
> news
> website ,(PHP & MYSQL)
> everything works pretty good on my local server
> but online
> when i enter a page
> i find that the colors i choosed changed
> would this be a problem on my code or on something on the server or the
> javascript
> i didn't know what part of my code to include here
> so can anyone tell me where is the problem ?
> code is available for discuss
And how does this relate to PHP??
--
--Matthew Sims
--<http://killermookie.org>
--- End Message ---
--- Begin Message ---
Hi,
I'm running PHP 5.0.0 with Apache 2.0.50 and have a problem with the
php_check_syntax function. When I use it, it loads all functions ans
classes. But I only want to check the syntax, not to load the files.
Is this a bug or a feature ?
--- End Message ---
--- Begin Message ---
Michael Scholl wrote:
I'm running PHP 5.0.0 with Apache 2.0.50 and have a problem with the
php_check_syntax function. When I use it, it loads all functions ans
classes. But I only want to check the syntax, not to load the files.
Is this a bug or a feature ?
I'd say it was a bug, but since the function isn't really documented,
it's hard to say what the intent of the function is.
There's already this bug regarding the second parameter:
http://bugs.php.net/bug.php?id=29454
This function seems really screwy anyhow. If I have a function foo() in
the file I'm checking and a function foo() in the main PHP file declared
after I check the syntax... I'll get a failure for checking the syntax
of the file... even though there isn't one.
test.php
<?php
$b = php_check_syntax('test1.php');
if(!$b)
{ echo 'Error in syntax'; }
function foo()
{ echo 'test.php::foo'; }
foo();
?>
test1.php
<?php
function foo()
{ echo 'test1.php::foo'; }
?>
I get the "Error in syntax" message although test1.php loads without
error on it's own and the foo() call outputs "test.php::foo"...
I'm going to open up a bug report and go over some of this. Seems like a
very handy function to have if it worked correctly.
--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--- End Message ---
--- Begin Message ---
Michael Scholl wrote:
I'm running PHP 5.0.0 with Apache 2.0.50 and have a problem with the
php_check_syntax function. When I use it, it loads all functions ans
classes. But I only want to check the syntax, not to load the files.
Is this a bug or a feature ?
Actually I found this bug (http://bugs.php.net/bug.php?id=27406) which
has the answer we're all looking for: Don't misuse the function. Very
helpful, eh? I added a comment to please enlighten us what the proper
usage was, so maybe that'll help.
--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--- End Message ---
--- Begin Message ---
Please do not reply to this email, or you will be taken off the mailing list.
--- End Message ---
--- Begin Message ---
Hi,
What is the reason, thath in the installation manual of PHP writes:
"WARNING:
Do not use Apache 2.0 and PHP in a production environment neither on Unix
nor on Windows. "
Thanks,
Rosen
--- End Message ---
--- Begin Message ---
Hi Rosen,
It doesn't hurt to use google you know.
[Q:]
Is there going to be a version of PHP 4.x which is declared stable for use
with Apache 2.x or, is this feature going to be reserved for PHP5?
[A:]
The development of the Apache 2 module is completely disconnected from the
PHP 5 efforts. I think that these efforts have slowed down to a halt, mostly
because of lack of interest in the PHP development community, mostly because
the only reliable way of using PHP and Apache 2 together is using the
prefork MPM, which is effectively very similar to Apache 1. Good Apache 2
connectivity is going to come at some point, but I'm not exactly sure when
it would be.
Basically PHP isn't threadsafe, and Apache2 uses threads.
I hope that helps.
"Rosen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> What is the reason, thath in the installation manual of PHP writes:
> "WARNING:
> Do not use Apache 2.0 and PHP in a production environment neither on Unix
> nor on Windows. "
>
> Thanks,
> Rosen
--- End Message ---
--- Begin Message ---
CHAN YICK WAI wrote:
> if a project is worked by a small team of developers, is there a tool for source and
> version management for php source code? e.g. check which part of source is modified!
>
> Thanks for information.
>
>
> Regards, Yw
If you're on windows I recommend using WinCVS and CVSnt. Also, you
should check for SubVersion and RapidSVN. I like them more, but have the
problem taht not intergrate with as many development tools as CVS.
On Linux, just check for CVS or Subversion. gCVS is also a nice
interface to CVS.
Regards.
Jordi
--- End Message ---