Community

Forums » SEPHP Help and Tips

Help Please website down since yesterday

    • 3 posts
    May 26, 2018 7:09 PM EDT

    If anybody can help my website went down and only show a error 500 and i emailed my host tmdhosting and they're are telling there is an error with the zend framework. Nothing was changed on the site prior to it going down. I woke up and it was down. If anybody can help it would be greatly appreciated. Website: www.ugeek.club Error: 26-

    May-2018 22:23:46 UTC] PHP Fatal error: Uncaught Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Prepared statement needs to be re-prepared in /home/ugeekclu/public_html/application/libraries/Zend/Db/Statement/Mysqli.php:214 Stack trace: #0 /home/ugeekclu/public_html/application/libraries/Zend/Db/Statement.php(303): Zend_Db_Statement_Mysqli->_execute(Array) #1 /home/ugeekclu/public_html/application/libraries/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) #2 /home/ugeekclu/public_html/application/libraries/Zend/Db/Select.php(711): Zend_Db_Adapter_Abstract->query('SELECT `engine4...') #3 /home/ugeekclu/public_html/application/modules/Core/Bootstrap.php(318): Zend_Db_Select->query() #4 /home/ugeekclu/public_html/application/libraries/Engine/Application/Bootstrap/Abstract.php(256): Core_Bootstrap->_initLog() #5 /home/ugeekclu/public_html/application/libraries/Engine/Application/Bootstrap/Abstract.php(207): Engine_Application_Bootstrap_Abstract->_executeResource('log') #6 /home/ugeekclu/public_html/application/ in /home/ugeekclu/public_html/application/libraries/Zend/Db/Statement/Mysqli.php on line 214
    This post was edited by Donna at May 27, 2018 5:04 AM EDT
    • 2534 posts
    May 27, 2018 5:03 AM EDT

    If no changes were made, ask the host if the database is down or if there's a server issue. I moved this to the proper forum section. Please check the categories before posting as News and Info is only for official SE announcements.

    • 18 posts
    July 10, 2018 11:40 PM EDT

    I have the same "Zend/Db/Statement/Mysqli.php on line 214" problem and it also happened with TMDHosting, since yesterday morning.  I was working on my site fine the night before and woke up to find the site showing me a "...currently unable to handle this request. HTTP ERROR 500" error or just a blank page, depending on the browser. 

    TMDHosting tried to fix the database and files with their backups and whatever else they did, however after a day they closed my ticket with the website still down.  The end result is them telling me to find a developer to figure this out.  Not that I blame them, this is turning out to be a mind-boggling critical problem.  All the work and hours I invested for months and now I can't even access the site.  I tested with different backups of mine that I knew had worked, but I still get the error message.  I tried installing a fresh version of SocialEngine 4.10.3p2 and was not successful; I got the message at step 3 as follow: "Mysqli statement execute error: Prepared statement needs to be re-prepared".  So the issue must be on the server's configuration of Mysqli, because the files worked before and now they don't and even a brand new version of SE won't install.  I think SE needs to consider fixing their use of Mysqli because a similar http 500 problem had happened before ("Bug in MySQLi extension causes Apache 500 error", LAST UPDATED: SEP 11, 2014 06:12PM PDT)

    Anyone else has this problem or know a solution to this?

    Here are the error logs for this problem:

    [11-Jul-2018 01:54:42 UTC] PHP Fatal error: Uncaught exception 'Zend_Db_Statement_Mysqli_Exception' with message 'Mysqli statement execute error : Prepared statement needs to be re-prepared' in /***/***/public_html/application/libraries/Zend/Db/Statement/Mysqli.php:214
    Stack trace:
    #0 /***/***/public_html/application/libraries/Zend/Db/Statement.php(303): Zend_Db_Statement_Mysqli->_execute(Array)
    #1 /***/***/public_html/application/libraries/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
    #2 /***/***/public_html/application/libraries/Zend/Db/Select.php(711): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select))
    #3 /***/***/public_html/application/modules/Core/Bootstrap.php(318): Zend_Db_Select->query()
    #4 /***/***/public_html/application/libraries/Engine/Application/Bootstrap/Abstract.php(256): Core_Bootstrap->_initLog()
    #5 /***/***/public_html/application/libraries/Engine/Application/Bootstrap/Abstract.php(207): Engine_Application_Bootstrap_Abstract->_executeResource('log')
    #6 /***/*** in /***/***/public_html/application/libraries/Zend/Db/Statement/Mysqli.php on line 214

    • 2534 posts
    July 11, 2018 5:17 AM EDT

    I found these in google and I have seen that issue before with old php versions. What php version and mysql version are on the server?

    https://xenforo.com/community/threads/mysqli-statement-execute-error-prepared-statement-needs-to-be-re-prepared.24497/

    https://xenforo.com/community/threads/error-on-install.17901/#post-236565 this one has good tips.

    This one has good tips too https://bugs.mysql.com/bug.php?id=42041

    I've not had this issue on my bryzar hosting but have seen it a few times at client sites on other  hosting. 

  • July 11, 2018 5:54 AM EDT
    Kieu Pham said:

    I have the same "Zend/Db/Statement/Mysqli.php on line 214" problem and it also happened with TMDHosting, since yesterday morning.  I was working on my site fine the night before and woke up to find the site showing me a "...currently unable to handle this request. HTTP ERROR 500" error or just a blank page, depending on the browser. 

    @Kieu: We can give a try to help you with the issue. Please contact our support team at support@socialenginesolutions.com if you wish us to look into the issue.

     

    Regards

    Team SES

    • 18 posts
    July 11, 2018 9:59 PM EDT

    Here are what showing in my phpMyAdmin:

    Database client version: libmysql - 5.1.73

    PHP version: 5.6.30

    Server type: MariaDB

    Server version: 10.0.35-MariaDB - MariaDB Server

    Thanks, looks like in the https://bugs.mysql.com/bug.php?id=42041 link, someone mentioned "The solution is to update to 5.7, the issue seems to be limited to specific old MySQL versions."  Maybe that could be a solution.

    • 18 posts
    July 15, 2018 12:46 AM EDT

    After several days of poring over stackoverflow and many other forums, I have figured out how to sidestep the mysqli error message and, as a bonus, was able to use PHP 7 and newer on my TMDHosting shared server; previously when switching to PHP 7 or newer, my site went down. In the database.php file, I changed the adapter from mysqli to pdo_mysql. I got the inspiration from this forum post: https://stackoverflow.com/questions/33696720/pimcore-exception-when-listing-objects.

    Question for SE: With using 'pdo_mysql' instead of 'mysqli' as adapter, will that affect the function of my site in any way?

    • 2534 posts
    July 15, 2018 5:39 AM EDT

    I don't know as we recommend Mysqli. We recommend using the default. TMD should be up to our requirements. I can already use PHP 7.2 on my site, this site uses PHP 7.1 or 7.2 and so do our demos and testing environments. I suggest checking further with TMD as something is messed up there. All of these environments are on Ubuntu. My local test sites are on Macbook pro using Mamp Pro in Apache environment. My Alienware Windows machine took a bit more to set up as SE doesn't work well on windows.

    • 18 posts
    July 22, 2018 8:22 PM EDT

    Solved, for now.  I upgraded my hosting plan with TMDHosting and was moved to a new server in the process.  My website is now working again under the original mysqli adapter.  If you can't move to a new server, I strongly suspect restarting the MySQL server and/or the Apache server will do the trick.  As noted at the MySQL bug report (https://bugs.mysql.com/bug.php?id=42041): "On a shared hosting solution, anyone else performing a mysqldump can bring all other websites down."  This has been a known bug with mysqli since 2009.

    Unfortunately, SocialEngine is dependent on the mysqli adapter.  I found that while running on pdo_msql, the "Block Member" function on a member profile will not work.  Switching back to mysqli, the "Block Member" worked again.  Who knows what other functions are dependent on mysqli.  Edit: Also affects privacy selector for first_name field, with mysqli it doesn't show because of SE's use for it as display name; with pdo_mysql, the privacy selector for this field shows up.

    If the opportunity ever comes up, I suggest SE start developing with ‘pdo_mysql’ by default instead of ‘mysqli’ as the adapter in its database.php file.

    Here’s a quote from a Zend_db developer from October 2010:

    I developed a lot of the Zend_Db component for Zend Framework through the 1.0 release…The same set of unit tests can be run against both MySQL adapters, with virtually no difference. Performance-wise, there's no measurable difference.

    The reason you would choose one over the other, and the only reason why we supported Mysqli at all, instead of only PDO_MySQL, is that you need to deploy to a PHP environment where you don't have the PDO extension enabled, and you don't have the privilege to modify the environment. For instance, a commodity hosting environment. (https://stackoverflow.com/questions/3844077/zend-db-adapter-mysqli-or-pdo-mysql)


    This post was edited by Kieuph at July 27, 2018 9:22 PM EDT