Enabling PostgreSQL with custom PHP on Windows Azure - php

I have deployed a PHP web app connects to a PostgreSQL on Azure Website. Azure Website doesn't support to customize system level extensions to be enabled using .user.ini given within the wwwroot folder.
I went ahead with custom PHP installation and did the following
Copied PHP binaries as described under \bin\php folder
Modified under \bin\phpphp.ini has been modified with.
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll
Added *.php* key and value D:\home\site\wwwroot\bin\php\php-cgi.exe under handler mappings
Added PHP extensions key PHP_EXTENSIONS and value D:\home\site\wwwroot\bin\php\ext under app settings configuration.
But when I look in to PHPInfo(), all the details are taken as configured but the extensions are not loaded.
I followed the guideline mentioned here - Using custom PHP Runtime
How to resolve this?

You have mixed the two different ways of bringing another dynamic extension to Azure Websites.
If you upload the php_pdo_pgsql.dll binary to D:\home\site\wwwroot\bin then add PHP_Extensions to the App Settings with the value bin\php_pdo_pgsql.dll it should fix your issues. if you have multiple extensions you want to enable, separate them with commas in the same App Setting value field
Alternatively, you could upload your own runtime, then you have full control over the php.ini which in included in the directory you upload the runtime to as described in using custom php runtime
Do note these are two separate options.

Related

Fatal error: Class 'XSLTProcessor' not found - but is installed

When try to do the following
$xsl = new XSLTProcessor();
I am getting this error
Fatal error: Class 'XSLTProcessor' not found in
I've seen this question about this exact same error (and this one) but I think this is different. Am I right in saying (I've tested it and appear to be) that because the extension details are shown in phpinfo() it is indeed installed correctly?
Is that the case, or would it always show in phpinfo() regardless of it being installed successfully? And do you know what might be causing the error if it is successfully installed?
I've tried several versions of PHP and for what it is worth I am hosted on Azure and have followed and checked the instructions here which further leads me to believe the extension is installed correctly.
How did you enable the php_xsl extension on Azure? If you manually upload the DLL library to Azure and config via Configure via ini settings section of How to: Enable extensions in the default PHP runtime. It maybe that the DLL library you configured doesn't match the PHP version or OS version.
However, Azure Web Apps has already contain the php_xsl.dll library in the ext folder of PHP runtime in every available version. But by default Azure PHP runtime doesn't enable it. you can login Kudu console site of your Azure Web App service, and direct to the default ext folder, e.g D:\Program Files (x86)\PHP\v7.0\ext. You can find all the libraries provided by Azure.
So, please delete your old configurations, and try to follow the Configure via ini settings section of How to: Enable extensions in the default PHP runtime, add the configuration in the extensions.ini:
extension=php_xsl.dll
Any further concern, please feel free to let me know.

upgraded mysql to 5.5 on windows / php doesn't connect to mysql API

i was upgraded mysql to 5.5
but i don't know why php does not connect to mysql API
in info file written
Client API version mysqlnd 5.0.11-dev
my server is windows server / using IIS
Installation
First thing to do after you download and extract phpMyAdmin is place the extracted files in the appropriate directory inside your IIS web root so that IIS is able to access it. You may wish to create a separate website for your phpMyAdmin installation, or simply add it as a sub directory or virtual directory under an existing website. Either way you'll need to make sure that the user account used by IIS to access your files has at least NTFS read permissions to all of your files once they are in place.
In this guide we'll place the phpMyAdmin files in a directory called "pma" under the root directory of a website "example.com". Because phpMyAdmin enables you to directly manipulate, and even delete entire databases and users, it is highly recommended that you secure your phpMyAdmin installation using SSL. This can be done by purchasing a certificate from a 3rd party vendor which will cost money, or by creating self signed certificate for IIS yourself at no cost. With all this in mind, then to access the phpMyAdmin installation used in this guide you would type the following into the address bar of your favourite web browser;
PHP Settings
phpMyAdmin uses several PHP extensions to perform its various functions. The extensions you'll need for phpMyAdmin are;
MySQL (to connect to the MySQL server on web hosting)
MCrypt (highly recommended for performance when using the cookie authentication method, and actually required for 64-bit environments)
MBString (used for multi-byte character support)
GD2 (image creation and manipulation library)
To enable these extensions open you php.ini file and navigate to the list of extensions and find these extension names;
;extension=php_gd2.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mysql.dll
Simply remove the semi-colon (;) from that start, save the file and restart IIS to reload your PHP environment. These extensions should now be loaded into your PHP environment, and can be verified using the phpinfo function as described in the PHP installation guide.
And I found lot of possible answers in google
you can go through this links.
Install and Configure MySQL for PHP Applications on IIS 7
Use the Database Manager
Configuring PHP with MySQL for Apache 2 or IIS in Windows
Install and configure phpMyAdmin on IIS

On Windows 8 and Internet Information Service 8.5 - how to setup PHP?

Let me begin by saying that I am very new to Microsoft's Internet Information Service. I need to setup IIS on my PC and it should also execute PHP files. So far I got everything installed and running - the latest PHP and enabled IIS service. I can view the Default Webpages (*.html) files ONLY. It will not execute PHP files. If I try to request any PHP files, I get 403 error.
I have been researching online and seems to be more confused about setting up PHP (extension) on IIS. Some websites say you need to configure PHP through its MANAGER. Others say I need to add Role and FastCGImodule through IIS manager. According to Microsoft I need to rename php.ini-development to php.ini and point php to some DLL file.
I am using Windows 8, IIS 8.5 and PHP 5.6. I hope someone could point me in the direction.
You can set this up manually or with the IIS Manager. I would set this up my own, so you know whats going on.
You will need to setup the CGI role feature. This includes FastCGI. Here is some information how to do that: http://www.iis.net/configreference/system.webserver/cgi
Then you will need the PHP package somewhere. Lets say in C:\PHP. You can change that if you want.
You will need the fastCGI settings. You can easily set this up by commandline:
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCGI /+[fullPath='C:\php\php-cgi.exe',activityTimeout='1200',requestTimeout='1200',arguments='-c%20C:\php\php.ini']
This example uses a timeout of 20min.
This will set the handler:
%windir%\system32\inetsrv\appcmd set config /section:handlers /+[name='PHP_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='"C:\php\php-cgi.exe|-c%20C:\php\php.ini"',responseBufferLimit='0',resourceType='Either']
php.ini setup:
[cgi-fcgi]
fastcgi.impersonate=1
cgi.force_redirect=0
cgi.fix_pathinfo=1
For write access you will need to grant "modify" access for the the IURS.
More Information: http://php.net/manual/de/install.windows.iis7.php
I did try the answer posted to heart, but I kept running into problems. In fact, I also followed the Microsoft step by step PHP setup tutorial to the TEETH. I still couldn't get PHP working on my IIS. Although Microsoft warned against using Windows Platform Installer(WPI), I downloaded WPI and ran the installer. Under frameworks, I found PHP 5.6 and clicked on Add button. Then, clicked on the Install button. It took only about 30 seconds to install. Just to be sure. I checked IIS manager and there it was PHP Manager. After opening PHP manager I noticed that all the settings were there and enabled and it already had 15 different extension enabled. Plus, it also had about 35 extension disabled, but it gives you option to enable them right there.
Now, my PHP files are rendered as expected. I even did phpinfo(); and the browser displayed all the PHP settings and information. :)

Is it possible to enable php_ldap in an Azure WebRole?

I have followed the instructions here: http://azure.microsoft.com/en-us/documentation/articles/cloud-services-php-create-web-role/#CustomizePHP for adding an extension but can not get the web role to recognize the extension.
Are you able to load other extensions? There was a bug in the past, see this post: http://social.msdn.microsoft.com/Forums/windowsazure/en-US/cd547ad3-c892-4ba4-82f4-c83690d18966/problem-with-loading-php-extensions
Also note that in order to load the php_ldap extension, it requires the following files: libeay32.dll and ssleay32.dll
Sorry for not coming back to you earlier. How are you getting along?
Since I never used a PHP based Cloud Service I did some testing for you. I followed the link you mentioned in your post with one exception: I did not add the php_ldap.dll to my Cloud Service.
After deploying the Cloud Service I verified a statement I remember about newer PHP installers for Windows:
They come with the required .dll files, like these for LDAP
They add the PHP folder containing the .dll files to your path variable
And this was indeed true. All required files are available and in the correct location.
This is the result I get when verifying LDAP from PHPInfo:
All seems to be ok. Can you try this and let me know how it goes.

How do I install ionCube on an Azure Web Site?

I am trying to follow the instructions under Using Custom PHP Extensions in Windows Azure Web Sites to enable the ionCube extension for PHP running within an Azure Web Site. Here's what I did:
Downloaded the Windows VC9 (Non-TS) (x86) loader from the ionCube loader download page.
Created a directory at /site/wwwroot/bin
FTP'd ioncube_loader_win_5.3.dll to that directory.
Under "app settings" in the Azure portal for the web site I added PHP_EXTENSIONS with value bin/ioncube_loader_win_5.3.dll.
I loaded http://my.azure.website/info.php and verified that the Environment table included PHP_EXTENSIONS = bin/ioncube_loader_win_5.3.dll. It also contains APPSETTING_PHP_EXTENSIONS = bin/ioncube_loader_win_5.3.dll.
When I try to load the site I get the message "The page cannot be displayed because an internal server error has occurred" and no additional information.
Is there something I forgot or is ioncube not supported on Azure? Did I set up the directory properly?
I also tried the Zend Guard Loader extension (ZendLoader.dll) in the same manner. I don't get an error message, but the extension doesn't show up in phpinfo() either.
I posted an article explaining How to configure ZendGuard on Windows Azure Web Sites
You shall not put the module in the root of the ftp site. The DLL module must reside in a folder below the APPLICATION ROOT, which is site/wwwroot/ So, you have to create either site/wwwroot/bin or anything of your choice (i.e. site/wwwroot/phpext), and then map PHP_EXTENSIONS again to bin/ioncube... (or phpext/iocube...), whatever is the name of your folder underneath site/wwwroot/!
However I am having trouble running any php page when the mentioned module is enabled. I don't know whether this is because my files are not ionCube encrypted, or because of some issue with the ionCube itself. So if you have a ionCube encrypted file, you have the chance to test.
ionCube is a Zend Extension, so according to an answer on windows azure forums:
The correct way to do it would be to create the /site/wwwroot/bin directory and upload ioncube_loader_win_5.4.dll there then add under the portal App Settings a PHP_ZENDEXTENSIONS setting with bin\ioncube_loader_win_5.4.dll as its value.
I confirm, but my tests was done in /site/phpext with an App Setting on ..\phpext\ioncube_loader_win_5.4.dll.

Categories