OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Installation/Technical Issues or Problems PDOException error after install on CentOS 7

This topic contains 4 replies, has 2 voices, and was last updated by  peeush 9 years, 5 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #26391

    peeush
    Participant

    I have installed orocrm v1.4 on CentOS 7 image, with nginx as the webserver. Had a number of challenges with permissions on folders and files, but once permissions were corrected, install went through fine.

    On trying to navigate to the login page, I am getting a blank page; below is the error logged in the nginx error logs:

    2014/11/13 21:46:20 [error] 12449#0: *5 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY000] [2002] Permission denied’ in /usr/share/nginx/html/orocrm/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40

    Any ideas on how to fix this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #26392

    Check your parameters.yml file for correct DB credentials.
    Also check that DB user has all necessary permissions granted. Required permissions are:
    CREATE, DROP, ALTER, DELETE, INDEX, INSERT, SELECT, UPDATE.

    #26393

    peeush
    Participant

    Thanks Dmitry; I re-checked the two (parameters.yml, database user permissions) and both are correct. This makes sense too as the install script running on the web/app server was able to connect correctly to the database server, drop the schema and create all required database entities/migrations etc.

    Some information on my setup: My web/app server (IP address: 10.0.0.4) and database server (IP address: 10.0.0.68) are on separate VMs, but par of the same vnet; This is what SHOW GRANTS FOR ‘root’@’10.0.0.%’ returns:
    | GRANT ALL PRIVILEGES ON *.* TO ‘root’@’10.0.0.%’ IDENTIFIED BY PASSWORD ‘<HASH>’ WITH GRANT OPTION |
    Equally, I have verified that port 3306 is open on the database server for connections.

    Below is what my parameters.yml contains:
    database_driver: pdo_mysql
    database_host: 10.0.0.68
    database_port: 3306
    database_name: oro_crm
    database_user: root
    database_password: <PASSEORD>
    mailer_transport: smtp
    mailer_host: 127.0.0.1
    mailer_port: null
    mailer_encryption: null
    mailer_user: null
    mailer_password: null
    websocket_host: 127.0.0.1
    websocket_port: 8080
    session_handler: session.handler.native_file
    locale: en
    secret: ThisTokenIsNotSoSecretChangeIt
    installed: ‘2014-11-14T02:00:29+05:30’

    Below is the full error log:
    2014/11/14 12:17:10 [error] 12449#0: *9 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY000] [2002] Permission denied’ in /usr/share/nginx/html/orocrm/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40
    Stack trace:
    #0 /usr/share/nginx/html/orocrm/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(40): PDO >__construct(‘mysql:host=10.0…’, ‘root’, ‘<PASSWORD>’, Array)
    #1 /usr/share/nginx/html/orocrm/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(41): Doctrine\DBAL\Driver\PDOConnection->__construct(‘mysql:host=10.0…’, ‘root’, ‘<PASSWORD>’, Array)
    #2 /usr/share/nginx/html/orocrm/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(356): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, ‘root’, ‘<PASSWORD>’, Array)
    #3 /usr/share/nginx/html/orocrm/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(680): Doctrine\DBAL\Connection->connect()#4 /usr/share/nginx/html/orocrm/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(” while reading response header from upstream, client: nn.nn.nnn.nnn, server: xyz.cloudapp.net, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php-fpm/php-fpm.sock:”, host: “xyz.cloudapp.net”

    Lastly, when I perform the same setup on a CentOS 6.5 image, all seems to go well…

    Appreciate your help on how to fix it!

    #26394

    You may try next:
    – connect from you webserver host to databse with same parameters from command line
    – check SELinux rules

    #26395

    peeush
    Participant

    Thanks for pointing me in the right direction Dmitry! It’s working now :-)

    The issue was because of incorrect SELinux settings on my web/app server; for any others users who may run into this issue – setting correct SELinux permissions for network connect resolved the issue for me:

    sudo setsebool -P httpd_can_network_connect_db 1
    sudo setsebool -P httpd_can_network_memcache 1

Viewing 4 replies - 1 through 4 (of 4 total)

The forum ‘OroCRM – Installation/Technical Issues or Problems’ is closed to new topics and replies.

Back to top