|
|
Error PArse Error Version 4.0
- Development Posted by kwells (Monday October 09 2000 @ 04:52PM EDT) views: 247 |
Why do I get
Parse error: parse error in
...phpweblog-0.4.0/include/layout.inc.php on line 46
|
|
By Anonymous (Monday October 09 2000 @ 09:33PM EDT)
|
No solution, but I do have my own 4.0 problems...
I just installed the package and I ran across a couple of things that don't seem to be config problems. (FWIW I have other PHP4 software running with no trouble.)
On the main page, I get this error:
Warning: Supplied argument is not a valid MySQL result resource in /usr/local/www/data/phpweblog/stories.php on line 59
The code on this line is:
$nrows = mysql_num_rows($result);
Secondly, I can't log in with the default admin password. Some poking around in mysql revealed that the config table (T_Config) lacks a field named "Passwd". This effectively prevents me from logging in or changing the password with the reset script. :)
|
[ reply | parent ]
|
|
By jason (Monday October 09 2000 @ 10:42PM EDT)
|
Well shit :/ I forgot to update the reset_passwd.sh script for the new T_Config schema. The query should be:
$MYSQL -u $USER $DATABASE -e "UPDATE T_Config set Value='5f4dcc3b5aa765d61d8327deb882cf99' WHERE Name = Passwd";
|
[ reply | parent ]
|
|
By mocha (Monday October 09 2000 @ 10:06PM EDT)
|
check for newlines at the end of that include file, check for missing or unmatched single, double quotes. most common mistakes for that error.
|
[ reply | parent ]
|
By Anonymous (Tuesday October 10 2000 @ 01:42AM EDT)
|
I am getting the same parse error, but there are no newlines or obvious unmatched quotes. I commented out the mysterious line 46, only to get the same error on line 113. The lines in question contain:
print eval($tmp);
Any other suggestions?
Thanks...
|
[ reply | parent ]
|
|
By james (Tuesday October 10 2000 @ 03:30AM EDT)
|
If you are using php 3.x it's probably because the eval() function returns nothing. I had this same problem and tried quite a few things before finally giving up and upgrading to php 4.x and the problem magically disappeared.
By the way, upgrading php is no simple task. Check your Linux vendor's website for help on this one. I found instructions at the Caldera site by searching on "php".
|
[ reply | parent ]
|
|
|
By Frank (Tuesday October 10 2000 @ 09:14AM EDT)
|
You might also wanna read the Apache-mod mini-howto. It builds Apache with PHP as a module, rather than compiled in, but modules work fine for me and it was very easy. (It's a little out of date, but the PHP3 instructions it gives still work for PHP4).
|
[ reply | parent ]
|
|
|
By Anonymous (Saturday October 14 2000 @ 01:38AM EDT)
|
You can correct it by changing the line from "print eval($tmp);" to "eval($tmp)" -- In PHP3 eval returns a void. PHP3 spits the dummy at being told to print that.
The other problem I had with 0.4.0 in PHP3 is the socket_set_timeout() calls. That function in PHP3 is called set_socket_timeout() swap it and that problem goes away too. However one that I couldn't solve in PHP3 was the language constant substitution. I kept getting things like "_FIND" and so on. This only went away in PHP4.
|
[ reply | parent ]
|
|
By shinobi (Tuesday October 10 2000 @ 03:56PM EDT)
|
I think jason should consider making it clear that phpweblog 0.4.0 requires php4! I have installed 0.4.0 to test it out and it chokes on the evals and if you comment the evals out it chokes on socket_set_timeout, if you take out the two set_timeouts phpweblog no longer spits out any errors, but doesn't spit out anything at all =( anyway, from the looks of it 0.4.0 just wont work with PHP3 =(
|
[ reply | parent ]
|
By Anonymous (Saturday October 14 2000 @ 12:34PM EDT)
|
I had the same thing shinobi said. I'm now downloading PHP4 and hopefully it will work.
|
[ reply | parent ]
|
By Anonymous (Saturday October 14 2000 @ 12:40PM EDT)
|
By the way, Apache Compile Kit is a really nice tool that makes compiling apache really easy. You can compile apache with php3, 4, mod_perl, etc.
|
[ reply | parent ]
|
|
|
|