PHP Extension not working on Windows Azure - php

I have just set up a Windows Azure website and I'm already having trouble making it work.
I have a PHP-website which works local on IIS for Windows 7 + MSSQL 2008.
The extension needed is pdo_xsl.dll and I have uploaded it using FTP to the wwwroot\bin folder.
Next, I have added the 'app settings'-string: PHP_EXTENSIONS = bin\php_xsl.dll in the Configuration tab for this site.
Then I saved and restarted the website but still got this error:
PHP Fatal error: Class 'XSLTprocessor' not found
Although the PHP INFO says:
xsl
XSL enabled
libxslt Version 1.1.27
libxslt compiled against libxml Version 2.7.8
EXSLT enabled
libexslt Version 0.8.16
I also use the URL method:
http://website.com/index.php/module/action/value/
It seems that Windows Azure is now seeing index.php as a directory instead of a file. As I'm using this method all over this script and it does work on IIS7 I would say it would work on IIS for Azure...

I have already solved this problem on my own.
The solution is quite simpel actually...
In 'App Settings' add this:
PHP_EXTENSIONS on the left side.
bin/php_xsl.dll on the right side.
PHP_EXTENSIONS = bin/php_xsl.dll
So it needs the forward slash instead of the backslash.
Please notice that the XSL dll files are not working on any PHP version.
The current version is only working on 5.4 and for every php version you can find another dll-file. 5.5 does not have it's xsl dll as far as I know for now. Just as pdo_sqlsrv.dll btw.

Related

How to connect to MongoDB using php on IIS

I have an IIS install (the one that comes with windows server 2016) with a working PHP 7.2 install.
I downloaded the php_mongodb.dll from here http://pecl.php.net/package/mongodb/1.5.2/windows (I grabbed the 7.2 x64 'thread safe' version -- matter?)
I copied the dll into the php extensions folder: C:\Program Files\PHP\v7.2\ext
I then added extension=php_mongodb.dll to the php.ini file located at C:\Program Files\PHP\v7.2\
I then restarted IIS (well, the entire system)
I can then run a phpinfo() and the results do not included the word "mongo".
I also try running print_r(get_loaded_extensions()); and the results do not include the word 'mongo'.
I further try running some of the options here:
http://php.net/manual/en/mongo.tutorial.connecting.php and recieve server errors in the browser.
... so, how can I get a php->mongodb connection?
(alternately, what I'm ultimately trying to do is connect a javascript SPA to a mongodb back end... are there other options than going through a php intermediary? -- it's an internal app, so security isn't the fearsome beast it would normally be)
Turns out the exact version of the dll you download matters. I needed the x86 non-thread-safe version for some reason.
Still can't get a connection, but at least it's in the list of loaded extensions.
try out all the possible files. atleast one may work i downloaded like 15 or 16 for my wamp 64 bit none worked.then i tried 7 versions in iis and finallly one worked. php version,build,archetecture all matters.

'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!

How to enable oci in xampp 5.6.3?

I am facing some issue while starting Apache server via XAMPP. I have installed XAMPP Version 5.6.3.
When I start the Apache server from xampp control panel, an error message is displayed as shown below:
On clicking 'OK' button, another dialog box is displayed as shown:
The thing is I wanted to use OCI instead of mysql. so I have commented out the mysql extensions and uncommented the OCI extension in php.ini file.
The php_oci8_12c.dll file is the only file available in the extensions (ext) folder of php in xampp. Hence I included the line in the php.ini as shown in the above image.
Since then I am getting this error.
I have installed instant client 12.1 as well but no luck. I also tried copying the OCI.dll from instantclient_12_1 and pasting it in c:/xampp/php and c:/xampp/apache/bin. The error still persists.
Need help..
UPDATE: I removed other oracle paths in PATH of environment variables, keeping only the instantclient path. Now I am getting this error..
Well, I've installed XAMPP 1.8.2, PHP 5.4 and Apache 2.0, and I use php_oci8_11g.dll and works fine.
You are trying use php_oci8_12g.dll, I recommend you read this link http://www.oracle.com/technetwork/articles/dsl/technote-php-instant-12c-2088811.html with especifications for run oci12g.
I solved the issue after stuck 2-3 days .
Before follow steps Some things to remmember .
1- I am using win 8.1 64 bit .
2- Using Xampp 5.6.31 32 bit .
3- Using instaclient 12.2.0.1 64 bit (Because my win 8.1 is 64 Bit ) .
Now steps are below -
Step 1 - Download xampp 5.6.31 32 bit and install it .
Step 2 - Download and install oracle 11g R2
Step 3 - Download and install OTN (oracle instaclient 12.2.0.1 )
Extract all files in any drive in my case i have extract in C:\oracle\instaclient12.2.0.1
Add (C:\oracle\instaclient12.2.0.1 ) it to the path variables of the system. and also add new variable under variable of system with name TNS_ADMIN and put same path (C:\oracle\instaclient12.2.0.1 ) in its value .
Its time to set PHP.INI here uncomment following (see image below)
PHP.ini setup
Copy 3 files from C:\oracle\instaclient12.2.0.1 oci.dll,oraociei12.dll and oraons.dll to xampp apache\bin . by this step Unable to load dynamic library issue has been resolved .
Unable to load dynamic library issue solution
Now restart Apache on xampp and check info.php on browser . OCI8 module will appear there enable .
Enjoy !!!.
I solved the issue. The problem was that I was trying to use a 64 bit DLL(php_oci8_12g.dll) in a 32 bit PHP. I downloaded a 32 bit instantClient and it works now! :-)
instantclient-basic-nt-12.1.0.2.0.zip
I had a problem related to OCI8 and XAMPP for days in a row, the problem was shown as:
Fatal error: Call to undefined function oci_connect()
I was able to correct it using the php that comes by default with XAMPP. I'm using windows 10 64 bits as well, but used xampp-win32-7.3.2-0-VC15 (php 7.3.2). To summarize, I was able to get a correct configuration by doing everything with 32 bits versions (except the o.s). The full story and how I've done it:
If you go to your xampp/php directory through cmd, in my case it was "C:\xampp\php", and start the php by the simple command "php" it will probably show what dlls are not being found in the etc folder or which of those are not Win 32 compatible. If you get this problem, you will not be able to see the OCI8 page when opening a phpinfo() page:
If that's the case, with win 32 compatibility problems or not finding the dlls that you are certain are there, you should unistall XAMPP and reinstall it using a x32 version. The phpinfo page will show x86 Architecture. Remember to remove in the path variables any source that miss locate your php in use, the point here is to use the one given by default in XAMPP. If you need by any reason to use another php installation, remember to use x86 architecture.
If you need an updated OCI8 dll you can download it on https://pecl.php.net/package/oci8 , but remember to check the Thread Safety compatibility, you can find it on your phpinfo page as well. In my case it was enough to use the one provided by XAMPP.
After this, you have to enable the extension:
extension=oci8_12c
in the php.ini configuration file. It was enough for me to enable only this one, although some people suggests to also enable extension=pdo_oci. My suggestion is to try this only if you failed to install with the path here shown. It's also good to check if you are set in the correct path regarding the extensions, in my case:
extension_dir="C:\xampp\php\ext"
After this, you have to download the Oracle Instant Client. Since you are using x86 architecture (you must use this one), you need to find a 32-bit version of the OIC, but is also important to check which one is compatible with the extension you uncommented. In my case, of oci8_12c, it was instantclient-basic-nt-12.2.
The final step is to unzip it to a folder, like "C:\instantclient_12_2" and add it to the path variables of the system.
Reload apache and check if the OCI8 is shown correcly.

How to connect to remote MSSQL database using php 5.5.19

I have had a problem trying to establish a connection to a MSSQL database I created in Microsoft SQL Server Manager 2008 R2 using php 5.5.19 in XAMPP.
In the php.ino configuration file under extensions, there is commented out a ';extension=php_mssql.dll'. I removed the comment and ran apache in the xampp control panel.
Naturally an error occurred stating ''PHP Startup: Unable to load dynamic library '..\ext\php_mssql.dll cannot be found'. I looked in the ext directory and sure enough it wasn't there. I added the mssql.dll file from
www.dll-files.com/dllindex/dll-files.shtml?php_mssql
,but then I got an Entry Point not found error stating 'The procedure entry point php_body_write could not be located in the dll php5ts.dll'.
After further research, I discovered that mssql_connect was not working since PHP version 5.3: http://php.net/manual/en/intro.mssql.php
I instead tried to use the 'sqlsrv_connect'' function, but I had to install the new drivers from https://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx
After reading the readme, I saw that I needed the libraries php_sqlsrv_55_ts.dll and php_pdo_sqlsrv_55_ts.dll to work with xampp's php5ts.dll in the php folder.
I added the libraries in the php\ext folder and added corresponding extensions to the new dll's and restarted Apache.
I then got an system error 'The program can't start because MCVCP110.dll is missing from your computer. Try reinstalling the program to fix this problem.' Obviously reinstalling isn't an option as I will lose my new dll's so I verified that MCVCP110.dll is in the php folder, which it was.
Please help, I really need to find a way to load the libraries with the 'sqlsrv_connect' function properly so I can connect to a MSSQL database.

How do I upgrade APC on Zend Community Server (needed for Symfony2)?

I am running latest Zend Community Server and want to learn Symfony2 but the config.php gives me an error that my APC (alternative php cache) is deprecated and I have to upgrade it.
I'm running OS X Lion and already found the zend folder in:
/usr/local/zend/
I also downloaded the source package (3.1.9 stable) from http://pecl.php.net but have no idea how to compile it or where to put it.
Ok, so I probably found best solution - Zend Server has build-in Zend Optimizer+, which is ~1.8 times faster that APC (320 req./s VS ~190 req./s or regular ultrabook).
So you just need to comment-out APC check in Symfony2 configuration - Caching will still work.
To disable APC in Symfony2, do this:
Open the Symfony2 requirements file:
/Symfony/app/SymfonyRequirements.php
And REPLACE the following lines of code:
if (version_compare($installedPhpVersion, '5.4.0', '>=')) {
$this->addRequirement(
version_compare(phpversion('apc'), '3.1.13', '>='),
'APC version must be at least 3.1.13 when using PHP 5.4',
'Upgrade your <strong>APC</strong> extension (3.1.13+).'
);
} else {
$this->addRequirement(
version_compare(phpversion('apc'), '3.0.17', '>='),
'APC version must be at least 3.0.17',
'Upgrade your <strong>APC</strong> extension (3.0.17+).'
);
}
with:
/* DISABLED FOR ZEND SERVER, USING ZEND OPTIMIZER+ INSTEAD
if (version_compare($installedPhpVersion, '5.4.0', '>=')) {
$this->addRequirement(
version_compare(phpversion('apc'), '3.1.13', '>='),
'APC version must be at least 3.1.13 when using PHP 5.4',
'Upgrade your <strong>APC</strong> extension (3.1.13+).'
);
} else {
$this->addRequirement(
version_compare(phpversion('apc'), '3.0.17', '>='),
'APC version must be at least 3.0.17',
'Upgrade your <strong>APC</strong> extension (3.0.17+).'
);
}
*/
Source: http://phpcloud-symfony2.pen.io/
I tested my previously posted (and now deleted) configuration a few times and had to withdraw the guide. The make test command returned a bunch of errors. The reason among other things is that Zend has their own bytecode in some extensions (like APC!).
I dumped Zend Server CE and switched to MAMP after all. Give my working guide on how to correctly set up Symfony 2 on MAMP a shot: Click here.
I found a possible solution here
Hope that helps
I'm a Mac user too, and I faced the same problem with Symfony and Zend Server. What I finally did was disable apc extension from my Zend Server control panel. Doing so, the warning that appeared into symfony configuration turned into a notice telling me to install apc or some other cache manager.
After that, I enabled apc again and everything is working fine. I now it's not a nice fix, but probably you're facing this problem when trying to develop locally, and you probably won't have this problem when you upload a site to a real hosting.
I hope it helps!
Zend Server does not support APC as far as I know.
They supply wrapper functions which map the APC functions to the Zend Data Cache objects.
WINDOWS ONLY
This worked for me:
Enabling Alternative PHP Cache (APC) extension in Zend Server CE
Download non-thread safe VC9 APC DLL (I went for php_apc-5.3-nts-svn20100226-vc9-x86.zip) from http://downloads.php.net/pierre/
Unzip it and put the extension dll php_apc.dll into C:\Program Files\Zend\ZendServer\lib\phpext (assuming you left the Zend Server install location as its default)
Add the following to your php.ini (in C:\Program Files\Zend\ZendServer\etc):
;Enable APC
extension=php_apc.dll
;Enable upload progress bar
apc.rfc1867=on
Give Apache/PHP a restart
Now check out phpinfo() on the Zend dashboard and you should see something like the following, with apc and the various directives being output in the configuration part of the output.
Any of the APC file upload progress bar plugins (e.g. http://www.ibm.com/developerworks/library/os-php-v525/index.html) should now work.

Categories