Receiving warning in PHP 5.5 "Deprecated: mysql_connect():"

Home Site Store Pro Knowledge Base (Public Support Forum) Resolving Common Issues Receiving warning in PHP 5.5 "Deprecated: mysql_connect():"

  • Author
    Posts

  • sitestorepro
    Keymaster

    Update 4/30/2016: The new version of the cart has been released that is 100% mysqli and will not receive any deprecation warning in PHP 5.5x and it also works with PHP 7+. More information is available at : https://www.sitestorepro.com/37th-release-posted/

    If you are receiving a deprecated function PHP error (warning) when running the cart in PHP 5.5, you can disable the warning message by adding a line to your database connection file.

    The new API based version of the cart uses mysqli in all front-end functions. However, the current admin area still uses the mysql_connect driver while we certify the new mysqli based admin area for public release.

    In the interim, you can simply suppress the deprecated mysql_connect warning message by adding the following line to your /Connections/SiteStoreProDB.php when developing your site.

    error_reporting(E_ALL ^ E_DEPRECATED);

    (The store/website will operate fine with the warning message disabled.)

    Example:

    error_reporting(E_ALL ^ E_DEPRECATED);
    $hostname_SiteStoreProDB = “localhost”;
    $database_SiteStoreProDB = “database”;
    $username_SiteStoreProDB = “root”;
    $password_SiteStoreProDB = “password”;
    $SiteStoreProDB = mysql_connect($hostname_SiteStoreProDB, $username_SiteStoreProDB, $password_SiteStoreProDB) or trigger_error(mysql_error(),E_USER_ERROR);
    # Set the install type for this cart
    define(‘SSPRO_INSTALL_TYPE’, 2); // (1 = Stand-alone, 2 = WordPress)

    Site Store Pro should not return any other PHP errors or warnings (except the above noted deprecated function error). However, you may have other applications running on your server/hosting account that may return errors .Therefore, for production environments (live stores),  PHP errors display should be turned off for security purposes: You can disable all errors via changing the ‘display_errors’ setting in your php.ini file or by adding the following to the top of your connection file :

    error_reporting(0);
    ini_set(‘display_errors’,0);

     

    • This topic was modified 4 years, 3 months ago by  sitestorepro.
    • This topic was modified 4 years, 3 months ago by  sitestorepro.
    • This topic was modified 4 years, 1 month ago by  sitestorepro.
    • This topic was modified 3 years, 8 months ago by  sitestorepro.
    • This topic was modified 2 years, 11 months ago by  sitestorepro.
    • This topic was modified 2 years, 11 months ago by  sitestorepro.
    • This topic was modified 2 years, 11 months ago by  sitestorepro.

You must be logged in to reply to this topic.


Search SiteStorePro.com

Subscribe To Our Email List