Installing PHP FileInfo Extension on Azure - php

Over the past two days, I have been scouring the web to figure out a way to enable the fileinfo extension for PHP 5.5 on Azure. I am in need of this feature in order to be able to check the type of files uploaded through a form. In my research, I have run into the following information:
First, I have found that, with PHP 5.5 (which I have running on my Azure instance), fileinfo should be enabled by default. That is the first concerning thing - as it is not.
Second, I have run into this resource. I followed the directions and created an App Settings variable entitled PHP_EXTENSIONS with a value of bin\php_fileinfo.dll. To see the structure of the website, visit the production repo here. This did not work.
In addition, I also found in the comments of the above forum that it may work if PHP_EXTENSIONS were changed to PHP_Extensions. I tried this, and still no luck. I also attempted using a backslash rather than a forward slash (as suggested in this forum) for the path to the dll, but that, too, was unhelpful.
Finally, in the event that the extension was present in Azure, but just not activated via php.ini, I used this forum to create a .user.ini to add the following line to php.ini that I assumed was likely commented out on the server:
extension=php_fileinfo.dll
Surprise! This, too, was unsuccessful.
I'm hoping there's someone out there who's had a similar problem with enabling PHP extensions in Azure that may be able to shed some light on this bleak situation. Many thanks!

Probably you are using the wrong php_fileinfo.dll. I had to download the exact same version of PHP that was running on Azure, grab the .dll, upload it and it worked.

Related

Need help in configuring WAMP (phpMyAdmin)

So I have been looking on the net for hours now and I can't solve my problem.
I have wamp installed (WampServer Version 3.1.7 64bit).
I want to open phpMyAdmin through wamp. (I have the phpMyAdmin5.0.2 installed and phpMyAdmin.conf is configured).
I have several php versions installed.(this was done through the process of trying to fix the solution alone).
When I try to open phpMyAdmin I get this error message: [1]: https://i.stack.imgur.com/ZEMaX.png .
I have tried configuring php.ini file (by de-commenting mysqli) it didn't change a thing.
Here's my php.ini file joined in the google drive link: https://drive.google.com/file/d/1fQuVoh5vhRX-MHhYL3zMQ4xNkstO-4Ch/view?usp=sharing .
I have configured extension_dir tp the php/ext folder.
I have similary configured my windows path to the php/ext.
Nothing I try works. Any help is welcome.
Thank you.
Since you're using WAMP, which should include all the pieces you need already working, but also have several PHP versions installed, it sounds like you're installing more than you need which is causing conflicts.
Assume you have no data in your database or web pages that you need to preserve, I suggest removing everything; get rid of WAMP and any extra Apache, PHP, or MySQL/MariaDB installations you have. Clean up (delete or move out of the way) any leftover configuration files, then reinstall WAMP. If you have trouble after installing only WAMP and no other PHP installation, then report back here details of the error. WAMP should come to you working and all ready to go, so if there is a problem, it will be helpful to start from a known base installation without extra configuration files or executable that will cause conflicts.
I'll also point out that the very top of the file you posted states that it's used only for the PHP Command Line Interface, so this is not the configuration file used by anything running through your webserver (like phpMyAdmin or your site). It's a little confusing that there are really two PHP instances (one for the command line and one that runs through the webserver), but in this case you would be looking for the file in wamp/bin/apache/apache2.x.y/bin/php.ini

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.

Symfony config.php keeps asking for enabling intl extension, though it is enabled?

I have come across this question which states exactly my problem, except that I'm using Wamp, not Xampp.
Symfony 2: Install and enable the intl extension
Though I enabled php_intl extension through the Wamp drop down menu, and making sure that the extension was not commented out in my php.ini configuration file, Symfony just keeps recommending me to enable intl extension.
I have visited the link in the accepted question:
http://php.net/manual/en/intl.requirements.php
Still no luck. I have visited the ICU Homepage and even attempted to download it, and then I just don't know what file to download or what link to follow.
I'd like someone who can point me to the right direction. I'm quite new to PHP (only two sites developed with it), and am a total beginner with Symfony. And I also can't understand all those tricks with Pearl, PECL, Composer, etc. I feel completely lost.
Thanks for any help.
Check the comments when you are using the app/check.php script:
* Configuration file used by PHP: /etc/php5/cli/php.ini
** ATTENTION **
* The PHP CLI can use a different php.ini file
* than the one used with your web server.
* To be on the safe side, please also launch the requirements check
* from your web server using the web/config.php script.
Make sure intl is enabled in the right php.ini file.
For getting started with Symfony I strongly recommend the video's from KNP University (knpuniversity.com). I thought they were excellent to get me started with Symfony. For composer enter $ php composer.phar list in the terminal to view all the options that come with composer.
After having searched and searched again and again, I have found that the history information of my browser fooled me.
First, I have copied the icu*.dll files from my %WAMP_INSTALL_DIR%\bin\php\php5.4.12 to my %WAMP_INSTALL_DIR%\bin\apache\Apache2.4.4\bin as mentioned here: intl extension php_intl.dll with wamp, and restarted all of my services.
Then, I had the idea of clearing my history, after having copied the files as above-mentioned, and it worked!
I do hope this will help others.

PHP on IIS 5.1 is not working

I know this has been asked a few times here. But none of the suggestions or answers related to PHP on IIS have helped.
I have tried installing PHP ON IIS 5.1 (XP SP 3) on two computers and it still doesn't work.
I've even began to think that all of the articles and installers for PHP on IIS are a huge prank...and that PHP on IIS doesn't actually work.
I've spent the last 6 hours trying to get it to work. Nothing does. As of right now when I navigate to http://localhost/phpinfo.php all that shows up is: "The specified module could not be found." My IIS applications still work perfectly.
phpinfo.php contains:
<?php echo phpinfo(); ?>
Even loading test.php with "Hello World." in it gives me the same error message.
The current installation of PHP was installed from http://php.iis.net/ (the big blue button in the middle of the page). This installed PHP in my programs directory (F:\PHP).
That didn't configure PHP to work so I manually added the Application Mapping in "Web Sites" > Properties > Home Directory > Configuration > Mappings > Add.
I added C:\WINDOWS\system32\inetsrv\fcgiext.dll, ext .php, "GET,HEAD,POST"
Anyone have any idea what my problem is?
Sounds like you've not installed the FastCGI components (which to be honest you don't really need on your local development machine). Can I suggest mapping the .php extension to:
F:\php\php-cgi.exe (or wherever the PHP binaries are installed)
Also make sure you give your site's anonymous user account at least read access to the F:\PHP folder and children.
I think the DLL you are using for getting PHP to work have a missing dependency. Why don't you get a WAMP.
Do you really need to use IIS, using Apache would be far more easy IMHO. If you really want to use IIS, I advise to install the official PHP release they have a good README which describe all the steps to configure IIS or even an installer.

Categories