andryus

Registered
Feb 11, 2009
3
0
51
Hello,

I need to build PHP 5.5 with custom flags, under easy apache 3 it is easy:

----

Edit /var/cpanel/easy/apache/rawopts/all_php5 and add this line in the
file as follows:

--with-mssql=/usr/local/freetds

Run easyapache and it will build with mssql support.

----

But, under easy apache 4 i does not know how i can do these procedures, i have created the file with the content but the custom flag is not loaded when i click into the provision button.

Any one can help me on this please?

Thanks!
 

sparek-3

Well-Known Member
Aug 10, 2002
2,183
285
388
cPanel Access Level
Root Administrator
See:

EasyApache 4 PDO_DBLIB (mssql support)

I believe the ODBC php module they are referring to is ea-phpXX-php-odbc

In your case, for PHP 5.5, this would be ea-php55-php-odbc

Which you can install on the server by doing:

Code:
yum install ea-php55-php-odbc
I really don't have any experience with using MSSQL, so this is where my help ends.

Of note, PHP 5.5 is end-of-life, it went end of life in July 2016:

PHP: Unsupported Branches

If your application is depending on PHP 5.5, it probably needs an update.
 

andryus

Registered
Feb 11, 2009
3
0
51
Hello, thanks for your reply, but i need MSSQL extension support, instead of pdo_dblib

Regards.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463

andryus

Registered
Feb 11, 2009
3
0
51
Hello,

There's no direct equivalent to the rawopts files in EasyApache 4. This is answered on the following thread:

EA4 equivalent for php rawopts ?

Are you sure the workaround discussed under the comments section on the below feature request wouldn't work?

EasyApache 4 PDO_DBLIB (mssql support)

Thank you.
Hello Michael,

Thanks for your reply, in terms of code, the MSSQL and pdo_dblib connection are distinct , i have many customers that require the MSSQL option enabled for their site.

Example:

mssql:

Code:
<?php
// El servidor con el formato: <computer>\<instance name> o 
// <server>,<port> cuando se use un número de puerto diferente del de defecto
$server = 'KALLESPC\SQLEXPRESS';

// Connect to MSSQL
$link = mssql_connect($server, 'sa', 'phpfi');

if (!$link) {
    die('Algo fue mal mientras se conectaba a MSSQL');
}
?>
PDO_DBLIB:

Code:
$myServer = "server name";
$myUser = "username";
$myPass = "pword";
$myDB = "dbname";

try {
  # MS SQL Server and Sybase with PDO_DBLIB
  $DBH = new PDO("dblib:host=$myServer;dbname=$myDB", $myUser, $myPass);
}
catch(PDOException $e) {
   echo $e->getMessage();
}
Regards.