Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Problem installing Phalcon on a fresh CentOS with cPanel

Hey, I've installed Phalcon on many systems , but am having troubles installing on a fresh CentOS machine with cPanel installed.

Here are the errors:

/root/src/cphalcon/build/64bits/phalcon.c:185:36: error: ext/pdo/php_pdo_driver.h: No such file or directory /root/src/cphalcon/build/64bits/phalcon.c: In function ‘phalcon_Phalcon_Db_init’: /root/src/cphalcon/build/64bits/phalcon.c:15120: error: ‘PDO_FETCH_USE_DEFAULT’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15120: error: (Each undeclared identifier is reported only once /root/src/cphalcon/build/64bits/phalcon.c:15120: error: for each function it appears in.) /root/src/cphalcon/build/64bits/phalcon.c:15121: error: ‘PDO_FETCH_LAZY’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15122: error: ‘PDO_FETCH_ASSOC’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15123: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15124: error: ‘PDO_FETCH_BOTH’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15125: error: ‘PDO_FETCH_OBJ’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15126: error: ‘PDO_FETCH_BOUND’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15127: error: ‘PDO_FETCH_COLUMN’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15128: error: ‘PDO_FETCH_CLASS’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15129: error: ‘PDO_FETCH_INTO’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15130: error: ‘PDO_FETCH_FUNC’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15131: error: ‘PDO_FETCH_NAMED’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15132: error: ‘PDO_FETCH_KEY_PAIR’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15134: error: ‘PDO_FETCH_GROUP’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15135: error: ‘PDO_FETCH_UNIQUE’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15136: error: ‘PDO_FETCH_CLASSTYPE’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15137: error: ‘PDO_FETCH_SERIALIZE’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:15138: error: ‘PDO_FETCH_PROPS_LATE’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_fetchOne’: /root/src/cphalcon/build/64bits/phalcon.c:36756: error: ‘PDO_FETCH_BOTH’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_fetchAll’: /root/src/cphalcon/build/64bits/phalcon.c:36790: error: ‘PDO_FETCH_BOTH’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_tableExists’: /root/src/cphalcon/build/64bits/phalcon.c:37153: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_viewExists’: /root/src/cphalcon/build/64bits/phalcon.c:37180: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_listTables’: /root/src/cphalcon/build/64bits/phalcon.c:37504: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_listViews’: /root/src/cphalcon/build/64bits/phalcon.c:37544: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_describeIndexes’: /root/src/cphalcon/build/64bits/phalcon.c:37585: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_describeReferences’: /root/src/cphalcon/build/64bits/phalcon.c:37654: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_tableOptions’: /root/src/cphalcon/build/64bits/phalcon.c:37760: error: ‘PDO_FETCH_ASSOC’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_Pdo_connect’: /root/src/cphalcon/build/64bits/phalcon.c:40101: error: ‘PDO_ATTR_ERRMODE’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:40101: error: ‘PDO_ERRMODE_EXCEPTION’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:40107: error: ‘PDO_ATTR_PERSISTENT’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:40111: warning: assignment makes pointer from integer without a cast /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_Pdo_Mysql_describeColumns’: /root/src/cphalcon/build/64bits/phalcon.c:40806: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_Pdo_Oracle_describeColumns’: /root/src/cphalcon/build/64bits/phalcon.c:41083: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_Pdo_Oracle_lastInsertId’: /root/src/cphalcon/build/64bits/phalcon.c:41235: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_Pdo_Postgresql_describeColumns’: /root/src/cphalcon/build/64bits/phalcon.c:41386: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_Pdo_Sqlite_describeColumns’: /root/src/cphalcon/build/64bits/phalcon.c:41662: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_Pdo_Sqlite_describeIndexes’: /root/src/cphalcon/build/64bits/phalcon.c:41841: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Adapter_Pdo_Sqlite_describeReferences’: /root/src/cphalcon/build/64bits/phalcon.c:41924: error: ‘PDO_FETCH_NUM’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘phalcon_Phalcon_Db_Result_Pdo_init’: /root/src/cphalcon/build/64bits/phalcon.c:44931: error: ‘PDO_FETCH_OBJ’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Db_Result_Pdo_dataSeek’: /root/src/cphalcon/build/64bits/phalcon.c:45100: error: ‘pdo_stmt_t’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:45100: error: ‘stmt’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c:45137: error: expected expression before ‘)’ token /root/src/cphalcon/build/64bits/phalcon.c:45147: error: ‘PDO_FETCH_ORI_NEXT’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Mvc_Model_refresh’: /root/src/cphalcon/build/64bits/phalcon.c:66809: error: ‘PDO_FETCH_ASSOC’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Mvc_Model_Resultset_Complex_construct’: /root/src/cphalcon/build/64bits/phalcon.c:90702: error: ‘PDO_FETCH_ASSOC’ undeclared (first use in this function) /root/src/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Mvc_Model_ResultsetSimpleconstruct’: /root/src/cphalcon/build/64bits/phalcon.c:91071: error: ‘PDO_FETCH_ASSOC’ undeclared (first use in this function) make: *** [phalcon.lo] Error 1

I was told this means I don't have the PDO headers in my PHP installation, but not sure what I can do to resolve this, as this is truly a fresh installation without any changes except for installing cPanel out-of-the-box

Thanks Shai



2.8k
Accepted
answer

Solution was easier then expected. Had to rebuild Apache and PHP with PDO enabled.

This is done easily in cPanel with WHM =>Software => Easyapache =>select Apache and PHP version (leave current version if you don't want to upgrade) ==> Go to "Exhaustive options" in this list you have to select "PDO" option -> Save and build Apache.