Viewing 14 replies - 1 through 14 (of 14 total)
  • It seems likely that is a coding error in the p2 theme’s functions.php file. It’s saying there is an endwhile statement in the wrong place. It often means the error is above that statement – it encountered the endwhile by falling through out of some unclosed If block for example.

    If you can’t find it, if you post the contents of functions.php in a pastebin someone can help you locate the error.

    here it is 🙂

    it’s the default functions.php in p2 theme downloaded in the theme’s directory.


    Line 1181 of that code is missing a closing PHP tag

    What is there


    What needs to be there

    } ?>

    I haven’t run the code – my syntax error checker found that. Give it a try and see if it resolves the problem.

    If it does, double check with the theme file you downloaded – if it is missing in the original file, let the theme author know so it can be corrected. It seems likely though that somehow it was removed in your installation only, as this would happen to everyone if it was in the distributed theme code.

    I am having the same problem on my self-hosted WP, running on WAMP. I tried adding the closing PHP tag, per stvwlf’s post. When added, the same error occurs, but on line 730.

    I’m thinking the problem is not an absent closing PHP tag.

    WP 2.7.1
    MySQL 5.0.18
    PHP 5.1.2


    I’m not running the code and I don’t see exactly what is going wrong. If you are both having this error in the same place, it is likely a bug in the theme code.

    Thanks for the notice. I’ll take a look and figure out what is going on.

    happened with every svn I tried these days, at the same point
    let us know 🙂

    just installed P2 . My website has disappeared
    . Error message
    “Fatal error: Cannot redeclare class Services_JSON in /home/322/first121/ on line 116”
    what is wrong ?

    problem persist even in 1.0.3

    PHP Parse error: syntax error, unexpected T_ENDWHILE in /srv/vhosts/ on line 729, referer:

    Noel, any news?

    @ghoulsnghosts Could you send me more specific information regarding your problem? php version other plugins you’re running and perhaps any other errors that are showing up around there?

    sure 🙂

    When I try to preview the theme, It happens. The preview shows me a blank page. If I try to apply the theme to my site, gives me the same error on the error.log I already posted (internal server error in IE).

    WP 2.7.1
    Web server: Apache/2.2.4 (Linux/SUSE)
    MySQL: 5.0.45
    PHP Version 5.2.6

    Plugins: Akismet, Facebook Connector, Google Analytics for WordPress, Google XML Sitemaps, Sort by Comments, Whydowork Adsense, WordPress Database Backup, WP Recent Tags, WP Super Cache.

    Could it be related to ?

    with the fix n. 1 at everything worked fine 🙂

    Fix worked for me as well. Thanks @ghoulsnghosts for the pointer and thanks to @lilyfan for the solution.

    Here is @lilyfan‘s fix that worked for me (from

    (1) There are two shorthand PHP tags. Because my server is “short_open_tag = Off”, a PHP parse error was occur.

    The fix point is below.

    * line 429 of functions.php
    <div class=”postcontent<?php if (current_user_can( ‘edit_post’, get_the_id() )) {?> editarea<?}?>”….

    should be:
    <div class=”postcontent<?php if (current_user_can( ‘edit_post’, get_the_id() )) {?> editarea<?php } ?>”

    * line 27 of entry.php
    <div class=”postcontent<?php if (current_user_can( ‘edit_post’, get_the_id() )) {?> editarea<?}?>”…
    shoud be:
    `<div class=”postcontent<?php if (current_user_can( ‘edit_post’, get_the_id() )) {?> editarea<?php } ?>”

    The newest version of P2 fixes all of these issues.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘php error’ is closed to new replies.