Jump to content

PHP and SQL Server


samerhannoun

Recommended Posts

Dears,, I need your suggestion and help about the following caseNow I forced to develop a Social Engine using ASP.NET and SQL Server Databasebut I have more experiences in PHP, the constant part of the project is the database and its SQL Server. So,, The situation will be like the following Social Engine developed using PHP has a domain + hosting The database of the social engine will be SQL Server on remote hosting [forced]So what is conditions I should write for the hosting to do this?and is this possible?I never try this!Please help ASAP.thank for all

Link to comment
Share on other sites

The SQL server needs to enable remote connections and allow the IP of your web server with PHP to access it. Otherwise, the SQL server and the web server with PHP installed need to be on the same computer.After that, from PHP, you can use PDO with the MSSQL PDO driver, or Microsoft's sqlsrv extension (make sure to read its documentation at MSDN).

Link to comment
Share on other sites

The SQL server needs to enable remote connections and allow the IP of your web server with PHP to access it. Otherwise, the SQL server and the web server with PHP installed need to be on the same computer.After that, from PHP, you can use PDO with the MSSQL PDO driver, or Microsoft's sqlsrv extension (make sure to read its documentation at MSDN).
Dear boen_robotIn fact until now I can't imagine the final project prerequisites and setuplets say the following"""shared hosting"""1. Linux hosting or windows hostingin case Linux hosting: is there support by default for SQL Server, or there are any configuration I should make on the host?.in case windows hosting,, IIS web server, I never deal with something like that, I should install PHP_PDO_SQLSRV.dll file and PHP_SQL_SRV.dll.and there are anther ext. MSSQL but not working with me on localhost.can u give me a link or can you describe the case for me I can't see clearly man!!!!I spend 8 hours today to understand the case but I can't till now?
Link to comment
Share on other sites

Dear boen_robotIn fact until now I can't imagine the final project prerequisites and setuplets say the following"""shared hosting"""1. Linux hosting or windows hostingin case Linux hosting: is there support by default for SQL Server, or there are any configuration I should make on the host?.in case windows hosting,, IIS web server, I never deal with something like that, I should install PHP_PDO_SQLSRV.dll file and PHP_SQL_SRV.dll.and there are anther ext. MSSQL but not working with me on localhost.can u give me a link or can you describe the case for me I can't see clearly man!!!!I spend 8 hours today to understand the case but I can't till now?
Dears I can Now tell you what I need exactly The Development EnvironmentOS:Windows XP,, Apache(easy php), PHP, SQL server 2005 or higher The Hosting Environment for the script OS: Linux, Apache, PHP. The Hosting Environment for the the databaseOS: windows, SQL Server 2005 or higher What is the required libraries or class for php to accomplish this?
Link to comment
Share on other sites

The computer on which the database is needs to be able to run the database server itself, i.e. it must be a Windows version on which your SQL Server version (whatever it is) can run on.The computer on which PHP is needs to have an available extension with which to connect to the SQL server computer. PHP and the extension itself need to be able to run on the OS of that computer.That is all you need to have in the end.If you're your own host (i.e. you have full control of the Linux server)Like I said, there are two extensions that PHP can use (see above post). The sqlsrv extension is precompiled for Windows (i.e. PHP running on Windows), so since PHP will be running on Linux, that's not going to help... you could in theory recompile the sqlsrv extension for Linux, but that's far from trivial, so you'd probably be better off using the PDO extension.What must you do?You need to ask your host to install the PDO extension and the MSSQL driver or compile and install the sqlsrv extension (I'd hope they can do this). Whichever extension they install, install and use the same one on your development server.

Link to comment
Share on other sites

The computer on which the database is needs to be able to run the database server itself, i.e. it must be a Windows version on which your SQL Server version (whatever it is) can run on.The computer on which PHP is needs to have an available extension with which to connect to the SQL server computer. PHP and the extension itself need to be able to run on the OS of that computer.That is all you need to have in the end.If you're your own host (i.e. you have full control of the Linux server)Like I said, there are two extensions that PHP can use (see above post). The sqlsrv extension is precompiled for Windows (i.e. PHP running on Windows), so since PHP will be running on Linux, that's not going to help... you could in theory recompile the sqlsrv extension for Linux, but that's far from trivial, so you'd probably be better off using the PDO extension.What must you do?You need to ask your host to install the PDO extension and the MSSQL driver or compile and install the sqlsrv extension (I'd hope they can do this). Whichever extension they install, install and use the same one on your development server.
thx dear,,,,Ok Now the vision is clear to start the work2 shared hostone for php based on linux OS,, the host should enable the PHP_MSSQL in the php.ini and install ntwdblib.dll.and the anther one for sql server database. thank u again
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...