PHP 4.4.7 and adodb MySQL
Bit of a long shot - just do 开发者_开发技巧a quick simple CMS of a client then realised that there host is running php 4.4.7
So once I've uploaded the code using php adodb - it won't even do a simple connect to the db - I've tried a simple connect using the direct MySQL method and that works.
So I'm guessing it's a compatability issue? I've look at the adodb manual it it says it supports from php 4.0.5 onwards - but can't think of why else it's not happening.
The error I get is Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /blah/blah/adodb/adodb.inc.php on line 435
Just a long shot but wondered if anyone knows a quick way to reolve, otherwise I'll have to strip out adodb, as they don't want to move hosts :-(
Yikes. Where did you manage to find a host still running PHP4?
Anyway, it sounds to me like the class is written using PHP5 syntax, despite you saying it supports PHP4.
I quickly looked up the web page for it (http://adodb.sourceforge.net/), and I found this in the documentation:
Requirements: PHP 5.0 or later. There is a version available that works with PHP 4.1 to 5.2 also.
...so it sounds to me like you've got the PHP5 version. You may need to dig up the PHP4 version instead.
However, I'd suggest trying to find a way to get the client's PHP version upgraded instead -- PHP4 is not supported any longer, and hasn't been supported for quite a long time now. It really does need to be upgraded.
It's also very likely that the old PHP4-compatible version of the library is no longer being maintained either, so if there's any bugs in it, or incompatibilities with other code you've written, then you'll be stuck.
And of course, that's just one library -- if you're using any other third party libraries, you'll probably come across the same problems or worse.
精彩评论