Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
  • #922600

    I am getting a Fatal error: Can’t use function return value in write context in PHP version 7.0.2
    installed the theme on a fresh installed wordpress site

    • This topic was modified 2 years, 3 months ago by  Lukevdp. Reason: typo


    Could you please post FTP and WP admin logins here privately so we can look into it?

    Best regards,


    sorry im testing it using my local server
    also i scan through the forum and i believe this is not just my issue but a general issue on the theme itself



    Issue was solved for users who upgraded their PHP versions to minimum 5.6. Please try restarting your server and check if that helps.



    I am using version 7.0.X


    fyi I tested other themes and the older enfold version and work fine



    Have you tried restarting your virtual server?
    Unfortunately your site should be publicly accessible for us to look into it to find out what is causing the issue.



    I did also like I said it has nothing to do with my server configuration.
    the error particularly point to
    $avia_config['use_standard_lightbox'] = empty( avia_get_option( 'lightbox_active' ) ) || ( 'lightbox_active' == avia_get_option( 'lightbox_active' ) ) ? 'lightbox_active' : 'disabled';

    also I am using the latest wp version , no plugin installed except for cf7

    I managed to fixed the issue by removing that line however I need a proper fix
    hopefully you can release one



    Currently you seem to be the only user who is having this issue and your installation is on localhost so there is not much we can do but to wait and see if anyone else will continue having the issue after upgrading PHP version.



    I am not the only one experiencing the issue to say the least, I did scan the forum and the comment section however I may be one of the few to report this issue, if they manage to fixed the issue by upgrading their hosting account, it means there is a compatibility issue with PHP that is less than PHP 7.1 though based on the code I provided, it has nothing to do with php compatibility , maybe have your developer look at it.



    I have personally tried upgrading PHP version to 5.6 on this users server as they have provided logins to their cPanel – and that helped. Later on i set it to 7.x.
    Minimum PHP version recommended for WordPress is 5.6. Therefore using older versions than 5.6 could possibly cause issues with plugins or WordPress itself. Upgrading minimum to 5.6 would solve the issue. WordPress is written in PHP and code you provided is part of our PHP code so it is actually PHP compatibility issue.

    As i said, if anyone else reports the same issue on PHP 7.x, we will look into it however until now, only case we have is yours and that is on localhost. For testing purposes, you can create a testing environment – and if you still have the issue, you can post FTP and WP admin logins here privately and we will look into it.



    Same error here:
    Fatal error: Can’t use function return value in write context in /[…]/wp-content/themes/enfold/header.php on line 6

    Happened for my english version of the site right after updating the theme from 4.2.3 to 4.2.6.
    Besides… where do I find the ressources for a rollback?



    @eee_lala Sorry for the inconvenience. Please upgrade PHP version to minimum 5.6 or replace /wp-content/themes/enfold/header.php file with this one – to bring up backwards compatibility with older PHP versions. Please also see –

    Best regards,


    Hey Yigit,

    that helped, thank you.
    I am rolling on 7.70 now, just in case it helps someone with the same error.


    This is associated with ENFOLD and the recent update.

    I have the same issue: Fatal error: Can’t use function return value in write context in /home/gregwesterra4717/public_html/wp-content/themes/enfold/header.php on line 6

    Using a back up, I restored my site last night…everything was fine until, that is, I updated the theme to 4.2.6 and then BOOM….the fatal error.

    Wordpress is up to date, so it’s in your update.

    I am putting log in credentials for enfold to sign in…in Private Content.


    Just a second, Edelabarre,
    IF the theme now requires PHP7
    THEN just upgrade to some PHP7 stable that your hoster provides.


    I am using PHP 7.0.X and i still get the issue
    the recommendation is only 5.6 above



    @lukevdp have you used cache plugin? If you have, please remove cache related files inside wp-content folder and check if that helps. Alternatively you can replace header.php file with this one – so it would work on PHP versions older than 5.6 as well.



    @yigit I already fixed it a few days ago but like I mentioned to you before, people would report this issue and suggest to have your developer look at it


    FYI: I had this issue – my error was related to a php file involving the header. I asked my host to upgrade my php version. I am currently running 7.0.25 and it is working again.

Viewing 20 posts - 1 through 20 (of 20 total)

The topic ‘Fatal error: Can’t use function return value in write context in’ is closed to new replies.