Connecting to MSSQL-Server 2008 under Zend server - php

Hi I'm currently trying to connect to MSSQL-Server-2008 using php on a Zend (web) server.
I've tried out a few things now but always end up getting:
PHP Warning: PHP Startup: Unable to load dynamic library 'E:\Zend\ZendServer\lib\phpext\php_pdo_sqlsrv_53_ts_vc9.dll' - The required module was not found
(sry if the error message sounds a bit strange I translated it manually into english)
First step I did was to download:
Microsoft SQL Server 2008 R2 Native Client
2nd step was that I downloaded:
SQLSRV20.EXE and extracted the files into the phpext directory.
3rd step was that I tried to turn on:
pdo_sqlsrv_53_nts_vc9
and / or
pdo_sqlsrv_53_ts_vc9
And restarted php.
Regardless of what I did I received the above error message.
Thus every time I try to connect to the mssql server I get an error message:
*PHP Fatal error: Call to undefined function sqlsrv_connect()*
Are there any additional steps needed?
(PHP Version I use is: 5.3.9 with a very new version of the zend server).
thanks

In the Zend server itself there are SQL drivers install them along it with general installation.Once the installation is done turn on these extensions sqlsrv,pdo_sqlsrv in the php console.I don't know the exact reason but those extensions which come with SQLSRV20.EXE are not compatible and those cannot be loaded.
Regards,
Sri

Related

Access Sybase database from PHP

I have an application based on Sybase database. The application is running on a Windows Server 2003. I tried to fetch the database from the php and it is showing a number of dll files are missing including the php sybase extension. I checked the php extension dir and found that the file exists on the path where it is showing the errors.
Here i would like to mention that i installed xampp 1.8.0 on the windows server and enabled the sybase extension form the php.ini.
I used the following code to connect as mentioned on the php doc
<?php
$link = sybase_connect('SYBASE', '', '')
or die("Could not connect !");
echo "Connected successfully";
sybase_close($link);
?>
== Update ==
It was showing that the following dll files were missing and i downloaded and added them manually.
libcs.dll
libintl.dll
iconv.dll
Now i am getting the following error,
The procedure entry point iconv_open could not be located in the dynamic link library iconv.dll
This error is present from the beginning of enabling the Sybase PHP extension.
PHP Startup: unable to load dynamic library 'C:\xampp\php\ext\php_sybase_ct.dll' - the specified procedure could not be found
When I've seen unable to load dynamic library 'C:\xampp\php\ext\php_sybase_ct.dll' the issue has come down to a) having an old/outdated set of libs or b) using an application that references the 'old' Sybase lib names (with ASE 15, Sybase changed the names of their libs and some apps haven't picked up on this).
For the first issue the obvious (?) resolution would be to download the appropriate set of Sybase libs (which is going to depend on your application code/version as well as the ASE version). [Not enough info in your post to know if this explains your scenario.]
For the second issue there's a relatively easy solution (the following is based on a PHP app that has a Sybase-specific sub-directory containing the Sybase client-side libs):
in a Windows cmd window ..
source the *.bat file for your application [load your app's env]
cd to the Sybase sub-directory named ...\OCS*\scripts
run copylibs.bat
try starting your PHP app again and ...
if the issue is fixed then the php_sybase_ct.dll error message should go away

'c:/wamp64/bin/php/php7.0.10/ext/php_oci8_12c.dll' - %1 is not a valid win32 application

In order to access an remote Oracle database from php, I had to activate the extension php_oci8_12c. But when I do, it does not appear in the phpinfo().
On the other hand, I get in the php logs the error message:
[13-Jan-2017 08:39:48 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp64/bin/php/php7.0.10/ext/php_oci8_12c.dll' - %1 is not a Valid win32 application
I use php 5.6.25 and wampserver 3.0.6 (64 bit). How can I resolve this?
Well, I faced this error too and managed to fix it.
Before downloading every kind Oracle Client Version just take a look at your http://localhost/?phpinfo settings at Configure Command section.
This will tell, which version of Oracle was used to build your WAMP server.
The image above show this two lines:
"--with-pdo-oci=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shared"
"--with-oci8-12c=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shared"
Obviously tell us that InstantClient used is 64 bits.
There are two versions of InstantClient 12.1 x64: 12.1.0.2.0 and 12.1.0.1.0
I tested with 12.1.0.2.0 version and failed.
After that, I tested with old one, 12.1.0.1.0 version and worked.
Download from Instant Client for Microsoft Windows (x64) and extract the files below to "c:\oracle":
instantclient-basic-windows.x64-12.1.0.2.0.zip
instantclient-sqlplus-windows.x64-12.1.0.2.0.zip
instantclient-sdk-windows.x64-12.1.0.2.0.zip
This will create the following folder "C:\Oracle\instantclient_12_1".
Using "Windows Command Prompt" (WIN+R CMD) go to folder above and execute SQLPLUS:
sqlplus [user]/[pass]#[host]:[port]/[service]
You must be able to connect.
Finally, add the "C:\Oracle\instantclient_12_1" folder to the PATH enviroment variable, placing it on the leftmost place.
Close your WAMP server.
Yes close it, because the Enviroment Variable is only read at launch time.
So restarting the services may fail, leading you to a wrong result.
After restart, your PHPINFO would show the OCI8 and PDO_OCI loaded.
I hope it helps!

connect to mysql database with php issue

I'm going to expand my local project (that used mysql database and php ) to web.
i upload all file and changed all addresses to my server.
but my app wont work and i get the error like this in server Error log:
[10-Feb-2014 04:06:38 America/New_York] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/magickwand.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/magickwand.so: cannot open shared object file: No such file or directory in Unknown on line 0
my app is load some list of goods. then it can be shown detail and edit.
there is no image.
what is this problem and how I can solve it?
You don't have ImageMagick installed at your server.
In order to use the MagickWand For PHP module's functions, you need to install ImageMagick version 6.3.5, or greater, and the MagickWand for PHP extension source code / DLL. For more detail please see here http://www.magickwand.org/

Incompatible file format error message with Zend Optimizer 3.3.9

On my local machine, I'm trying to deploy PHP code which was obfuscated using Zend Guard under the PHP 5.2.10 engine.
Since my machine had PHP 5.3, I reckoned the code does not run since it was obfuscated using Zend guard under the older PHP engine.
I managed to downgrade my PHP engine to 5.2.10, and also configured php.ini to use the relevant .so file from ZendOptimizer-3.3.9-linux-glibc23-i386.
However, when I try to run my website, I get the following error message:
Fatal error: Incompatible file format: The encoded file has format major ID 0, whereas the Optimizer expects 2 in /var/www/mysite/index.php on line 0
What could I be missing out?
It turned out that the index.php file was corrupt.
I replaced it with the correct file and then received the message "Invalid license."
I finally had to add a line in the hosts file to resolve the server's domain to localhost, since the Zend license is valid only for particular domains.

Using SQL Server in Cake PHP: PHP SQL Server interface is not installed

I inherited an old Cakephp site that was using adodb as a driver to connect to an MSSQL database and it turns out this is no longer supported in the new version of cake (1.3, we are in 1.2) so I'm trying to change the driver so I can upgrade. We're using IIS and a sql server 2005 database on a different server, php 5.2.17. However using driver "mssql" gives me the following errors:
PHP SQL Server interface is not installed. For troubleshooting information, see http://php.net/mssql/
Call to undefined function mssql_min_message_severity()
The top error leads me to a page regarding the old php_mssql.dll, which according to this question: ( CakePHP: error when trying to use mssql datasource ) will become a problem when I switch to PHP 5.3 so I'm trying to use the php_sqlsrv*.dll for my php version but I still get the error. Could never get the mssql.dll one to work either. I do however see "sqlsrv support enable" in phpinfo.php and the whole sqlsrv section is intact there.
In cake php I'm using "driver => 'mssql'", is this the correct driver for the new sqlsrv dll? Is there something I'm missing? For kicks I tried 'driver' => 'sqlsrv', that fixes the php SQL Server interface error but I still get
"Fatal error: Call to undefined function sqlsrv_min_message_severity() in C:\Inetpub\wwwroot\riverstone-dev\www\cake\libs\model\datasources\dbo\dbo_sqlsrv.php on line 107"
Installing the latest SQL Native Client set from Microsoft and reenabling the extension in PHP has worked, albeit on a different server. Please try the drivers below if having a similar problem:
http://www.microsoft.com/download/en/details.aspx?id=20098

Categories