• Resolved pjh1950

    (@pjh1950)


    This morning my website would not load because of the following error :-

    Parse error: syntax error, unexpected ‘print’ (T_PRINT), expecting identifier (T_STRING) in /home/ormskirk/public_html/wp-content/plugins/contact-form-7/admin/includes/welcome-panel.php on line 9

    I have not changed anything and have limited knowledge so I do not know where to start to find a solution. In the meantime I have started up in ‘safe’ mode, de-activated the plugin and commented out calls to it. Can anyone point me in the right direction please?

    This is the relevant section from the automatic email I received telling me of this problem.

    When seeking help with this issue, you may be asked for some of the following information:
    WordPress version 5.7.3
    Current theme: Graphene (version 2.8.6)
    Current plugin: Contact Form 7 (version 5.5)
    PHP version 5.6.40
    
    Error Details
    =============
    An error of type E_PARSE was caused in line 15 of the file /home/ormskirk/public_html/wp-content/plugins/contact-form-7/includes/rest-api.php. Error message: syntax error, unexpected 'namespace' (T_NAMESPACE), expecting identifier (T_STRING)
    • This topic was modified 3 years, 1 month ago by pjh1950.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    You are using PHP version 5.6.40 that is no longer supported. The best approach to avoiding your problem is to upgrade PHP to 7.4 or higher.

    Checkout this related issue. There’s a temporary solution offered by @dreich there.
    https://www.ads-software.com/support/topic/php-parse-error-syntax-error-unexpected-print-t_print/

    Thread Starter pjh1950

    (@pjh1950)

    As I said, my knowledge is not very great, I cannot see how to upgrade the PHP version. My database is hosted on HostX and I cannot see any option for this. I tried to raise a support ticket but it asks for details about cpanel data which I do not understand. But also, if from my site I follow the link to ‘Learn more about updating PHP’ it takes me to a screen in ‘CloudLinux’ which tells me I do not need to do anything as it is handled by ‘Hardened PHP’!! So now I am doubly confused? Do I really not need to do anything, in which case how do I get contact_form_7 working again?
    Thanks again for any help.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Managing your websites securely is your responsibility as the site owner. Hire someone who can administer websites for you or close the site.

    Perze Ababa

    (@dansalan)

    I still had this issue despite my servers being on PHP 7.4.25. The only way to get my wp-admin page to load was for me to rename the constant ‘namespace’ into something else. When the page loaded, I deactivated the contact form plugin, then reran the plugin update.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Contact Form 7 stopped working’ is closed to new replies.