Tangential Topic: MacPorts PHP code broken by OS X update?

Scott Haneda talklists at newgeo.com
Tue Aug 17 13:42:10 PDT 2010


On Aug 17, 2010, at 9:54 AM, "John Korchok" <jkorchok at hotmail.com> wrote:

> I am using MacPorts PHP 5.3 on Leopard. I have lots of code that was working perfectly fine until I applied the 2010-004 security update (among others) this past weekend. Now I am getting:
>  
> "Fatal error: Cannot redeclare class EmployeeTable in /Library/WebServer/Documents/profile/EmployeeTable.php on line 4"
>  
> after signing in. None of the PHP has been changed.

Maybe it was always this way and certain conditions are causing this now. 

Can you wrap the EmployeeTable class in an if (class_exists(...)) type of condition, and print or log both sides of the condition, or move to using include_once/require_once?

I don't think this has anything to do with php configuration, MacPorts, or System software. It appears to me to be an edge case in your code. 

> - "which php" answers "/opt/local/bin/php", so that hasn't changed.
> - We only upgraded the OS, none of the ports, so the version of PHP hasn't changed.

It may be useful to see the output of phpInfo(); from one of your php scripts. Not from the command line, but run it from within/near where you are running the script that is giving you errors. 

> Ever since upgrading to PHP 5.3, I've seen way more of these "cannot redeclare" errors on code that otherwise seems fine. Googling the term just gets me pages of people who have accidentally declared a class twice. I can't find anything on what could cause previously good code to suddenly generate this error. Thanks for any help or redirection to a more appropriate forum.

Maybe this is expected behavior as a result of a past update from php4 to php5? Can you perform this test:
http://bugs.php.net/bug.php?id=39294
-- 
Scott * If you contact me off list replace talklists@ with scott@ *

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20100817/f683c993/attachment.html>


More information about the macports-users mailing list