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.
Related
I am trying to get memcahe enabled on my Phpinfo().
Hi everyone, I am a newbie when its comes to working with memcache. So I have been trying to get memcache enabled on my php, but I have had very little luck.
According to my phpinfo() my php build version is API320190902,TS,VC15 and entails that I have to enable php_memcache.dll which is of the same VC (i.e VC15).
I have done that, by placing the php_memcache.dll file in my php/ext folder and enabling the extension in my php.ini by stating "extension=php_memcache.dll". But despite doing all this, I can't seem to get the memcache enabled, and my phpinfo() does not show the desired memcached section.
Additionally my Apache log states
PHP Warning: PHP Startup: Unable to load dynamic library
'php_memcache.dll' (tried: C:\xampp\php\ext\php_memcache.dll (The
specified module could not be found.)"
Can someone kindly help me figure out where I am missing it, or not doing right?
By the way, I tested this on Xampp and the .dll file was downloaded from the link https://github.com/nono303/PHP7-memcache-dll
Attached are screen shots of my Apache logs, php.ini, php/ext and phpinfo().
There are common things that are often encountered in PHP and Memcache(D) related issues:
Do you need the MEMCACHED or the MEMCACHE extension?
Is the MEMCACHED server already running? (in your case, that's not the problem yet)
Is the installed PHP extension x64 and Threadsafe compatible (as your system requires by looking at your phpinfo).
Personally, I use another PHP extension which works perfectly under PHP7 and PHP8:
memcached 3.2.0 for Windows
https://pecl.php.net/package/memcached/3.2.0/windows
Note: in addition to the usual DLL extension that you will copy to php/ext/ (and enable in your php.ini), you will also need to copy libmemcached.dll and libhashkit.dll to a directory belonging to your system path.
I have a webapp (PHP site using CodeIgniter) hosted on Azure. I have a situation where I want to use the pthread module. Since pthread is not available in PHP out of the box, when I install it using Xampp server, I suspect that it won't be possible to use threading on Azure.
But I am not sure. Azure documentation also doesn't talk about it. Is there a way I can use it pthread on Azure?
I am able to use it on my local Windows machine, using pthread.dll.
To enable extension in Azure Web APP, we should customize PHP runtime on Azure. Please refer to official site.
For this issue,I have tried to install pthreads successfully. And I toke those steps as following:
1, I obtained a PHP 5.4 (5.4.43) VC9 x86 Thread Safe package from PHP site explored to folder named PHP. And followed the pthreads site, got the lasted version of pthreads.
2,Added pthreadVC2.dll (included with the Windows releases) to the same directory as php.exe and added php_pthreads.dll to PHP extention folder.
3,I uesd phpinfo() to find default php.ini file in Azure, which should be similar with the picture:
,
Then I browsed Kudu Console of my web app via https://<your_web_app_name>.scm.azurewebsites.net/DebugConsole/?shell=powershell.
Locate to the directory found above. Download the content to local saved as php.ini in the PHP directory. Uncommented extension_dir = "ext" in this file.
4, Add a bin directory to your root directory (for example, bin\php), and use FTP tool to upload the PHP runtime on it.
5,Browse to the web app in the Azure Portal and click the configure tab.
Add *.php to the Extension field and add the path to the php-cgi.exe executable at the Handler mappings section.
At last, we check the PHP env,we should see the result as below
and run the test code of pthreads to check the extension
If you have any concern, please feel free to let me know.
I had the ionCube Loader working and running on an Azure web app for a few months. Then, about a week ago, PHP started throwing a fatal error regarding ionCube out of the blue. Haven't gotten it to work since. I didn't touch the server for several days prior to this error appearing.
PHP Error:
PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0
I know this is usually caused by the wrong order of loading PHP extensions. Since I'm on Azure, I cannot fix the loading order in the usual way, since I have no direct access to the php.ini.
It was also working just fine for quite a long time.
My entry in Application Settings:
PHP_ZENDEXTENSIONS bin\ioncube_loader_win_5.5.dll
Any suggestions? Any more information I can provide?
UPDATE: After updating ionCube Loader, PHP now works. The loader doesn't show up as loaded in phpinfo however, and apps using it still can't pick it up. The Loader Wizard gives essentially the same error as I had before:
The ionCube Loader must be the first Zend extension listed in the configuration file, D:\local\Config\PHP-5.5.22\php.ini.
You can load your custom php runtime on Azure Web App. Instructions can be found here under "How to: Use a custom PHP runtime" section
https://github.com/Azure/azure-content/blob/master/articles/web-sites-php-configure.md
Once you configure custom php runtime, you can use your custom php.ini file in which you can define the order of loading for your extensions. Instructions on how to use custom php.ini can be found here:
https://github.com/projectkudu/kudu/wiki/Xdt-transform-samples#using-a-custom-phpini
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. :)
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.