Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

phalconPHP database Transactions fail

Discussion in 'EasyApache' started by Vafa K, Mar 17, 2018.

  1. Vafa K

    Vafa K Registered

    Joined:
    Mar 17, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Iran
    cPanel Access Level:
    Root Administrator
    I have developed a website using PhalconPHP. the website works perfectly fine on my local computer with the following specifications:

    PHP Version 7.0.22
    Apache/2.4.18
    PhalconPHP 3.3.1


    But recently I have migrated to a new VPS. with cPanel:

    CENTOS 7.4 vmware [server]
    cPanel v68.0.30
    PHP Version 5.6.34 (multiple versions available, this one selected by myself)
    PhalconPHP 3.2.2


    On the new VPS my website always gives me Error 500.
    in my Apache Error logs file:

    [cgi:error] End of script output before headers: ea-php70, referer: http://mywebsitedomain.net

    What I suspect is the new database System. the new one is not mySql. it is MariaDB 10.1. I tried to downgrade to MySQL 5.6 but the WHM says there is no way I could downgrade to lower versions.

    this is my config file:

    [database]
    adapter = Mysql
    host = localhost
    username = root
    password = XXXXXXXXXXXX
    dbname = XXXXXXXXXXXX
    charset = utf8
    and my Services.php:

    protected function initDb()
    {
    $config = $this->get('config')->get('database')->toArray();

    $dbClass = 'Phalcon\Db\Adapter\Pdo\\' . $config['adapter'];
    unset($config['adapter']);

    return new $dbClass($config);
    }

    And in my controllers... for example this code throws Error 500:

    $this->view->files = Patients::query()->orderBy("id ASC")->execute();

    !!! but changing id to fname fixes the problem: !!!
    $this->view->files = Patients::query()->orderBy("fname ASC")->execute();

    or even the following code throws error 500:

    $user = Users::findFirst(array(
    "conditions" => "id = :id:",
    "bind" => array("id" => $this->session->get("userID"))
    ));

    but again if I search by string fields there is no problem.

    is there a problem with the compatibility of PhalconPHP and MariaDB?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Can you verify if there's any additional output in the Apache error log when you notice the 500 error code in your browser? Are you using the same PHP handler (e.g. suPHP, DSO)?

    Thank you.
     
Loading...

Share This Page