Apache service won't start after enabling PHP extension Intl - php

so I need to use Intl extension and as usual I uncommented the line in php.ini file:
extension=intl
Then I try to restart the apache service from the Windows "Services" and a message appears giving me error #1067. If I try to start it from the command line, it seems to be working, even the log files don't report any error, but the service just doesn't start.
The only way I got it running, was launching it directly not as a service from the command line.
I've checked, and the php_intl.dll file is inside the "ext" folder, like all the other extensions that I've enabled so far.
Any ideas? I'm running on Windows 10.

The php_intl.dll needs to access the ICU dll set.
So look in your PHP folder for 4 files that start icu*.dll and copy those into your Apache\bin folder. Each time you change the version of PHP you are using you need to copy these files from the PHP folders to the Apache\bin folder as they change in different versions of PHP.
Because PHP runs in Apache when the intl dll needs access to these files it will look in the apache\bin folder

Related

Missing php_yaml.dll file

I'm using XAMPP with PHP 5.5.27 PHP and Windows 10 (x64). I'm triyng to install the YAML extention. Link from other topic is dead so I dowloaded files version PHP 5.5, x64, TS and NTS.
I placed file php_yaml.dll into c:\xampp\php\ext and yaml.dll files into c:\xampp\.
Then I added entry extension=php_yaml.dll just after extension=php_xsl.dll (as last entry of Dynamic Extensions.
At the end I restarted Apache.
Result is:
phpinfo() doesn't display info about YAML extention.
You want the Thread Safe(TS) version and as to 32/64bit it should match your XAMPP version rather than your OS version so if you have a 32bit XAMPP you need the 32bit php_yaml.dll Also you should only need to place it in the c:\xampp\php\ext folder
Also remember that there are 2 php.ini files. One in the c:\xampp\apache\bin folder that Apache uses and one in c:\xampp\php\php.ini, it is this one that controls PHP's config when being used from the CLI (Command Line Interface) So you also need to add the extension=php_yaml.dll to this php.ini file as well if you want command line PHP to load this extension.
To check which php.ini file is being loaded in the CLI do this from the command line
php -ini | more
Look for this entry
Loaded Configuration File => D:\wamp\bin\php\php5.6.15\php.ini
Check that yours says something sensible for your system

Unable to locate php.ini file or paths to it on mac

I've just starting working on a mac so this is probably very obvious.
I've installed php, pear, and lastly pecl.
My last command was sudo pecl install mongo and am prompted to add the line extension=mongo.so to php.ini configuration.
I am unable to locate the php.ini file. I do a quick php --ini in the CL and am told the path is /etc, /etc/php/apache2/php.ini to be exact. I've tried to unhide files and well as searching via the finder but am told these directories don't exist, even though I believe my installations were done correctly. How can I access this etc directory, as well as others like the php5 folder so I can edit my php.ini file? Thanks. Using Yosemite 10.10.3 and latest php packages.
Just check the phpinfo output to locate the loaded php.ini file (Loaded Configuration File).

Enabling CURL with PHP 5.6 on Windows 8

I have Apache 2.4.12 and php 5.6.9 on my Windows 8 computer and I'm trying to enable the curl extension for php however, I haven't had much success. After searching the internet for this issue it appears that other's have had the same trouble. Here are the suggestions I've found:
Uncomment ;extension=php_curl.dll in php.ini
Uncomment ;extension_dir = "ext" in php.ini
Download and replace the php_curl.dll file in the ext directory of php with one from this website
Add to the PATH environment variable where php is installed
Copy libeay32.dll and ssleay32.dll from where php is installed to C:\Windows\System32
I've tried every single suggestion with no success except the third item in the list because it doesn't have a .dll file for curl with php 5.6, in fact the highest version avaible is one for php 5.4. There has to be way to enable this extension without having to downgrade my php version to 5.4 and using a .dll file from that website. I've tried searching the internet for a .dll file like the one on the linked website for php 5.6 opposed to a version of php that's outdated but I've had no luck in finding one so I'd like help with this issue.
How can I enable curl for php 5.6 on my Windows 8 machine?
Locate your php folder and follow these instructions:
Move to Windows\system32 folder:
libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll
Move to Apache24\bin folder
libssh2.dll
Uncomment extension=php_curl.dll
Note: Don't overwrite when prompted.
Source
I give you an example of a set up that just worked perfectly for me :
downloaded the VC11 x86 Thread Safe version of PHP,
unzipped it within a directory C:\php,
edited the php.ini-development, uncommenting 2 lines :
extension=php_curl.dll
extension_dir = "ext"
saved this file under php.ini.
I just tested it via the CLI (windows CMD here) on a PHP a file (i.e. C:\php\php myFile.php) and cURL worked.
If you have Apache installed and prefer to test it in a browser, you obviously have to adapt this installation with your own files structure and to do not forget to restart Apache.
Running apache service with a specific user other than local system solved the problem for me. You can test this easily by stopping the apache service and running manually <apache dir>\bin\httpd.exe.
I fixed this problem by adding C:\php and C:\php\ext to PATH system variables.
Press window + pause to bring up the System Properties page.
Click Advanced System Settings
Click Environment Variables
You'll see the Path variable in the System Variables box in the bottom.
Append your PHP path to that variable. Now the system will be able to load the extensions.
In addition to uncommenting the line
;extension_dir = "ext"
Try also setting it to the absolute path of the PHP installation's ext folder and then restarting apache.
e.g.:
extension_dir = "C:\PHP 5.6.19\ext"

PHP unable to load php_curl.dll extension

Follow-up from my post yesterday (Enabling cURL with PHP)
The problem is that PHP isn't able to load php_curl.dll. I've tried several steps including uncommenting extension=php_curl.dll, making sure the dependencies libeay32.dll and ssleay32.dll eixst in the path, re-downloading php_curl.dll, replacing the old one, and lastly copying the file into my System32 folder.
I'm using Apache 2.2 and PHP 5.4.14. I installed both using their individual packages; I'm not using XAMP or WAMP. I'm using Windows 7 64-bit.
Any help at all would be appreciated.
libeay32.dll and ssleay32.dll have to be path-accessible for php_curl.dll loading to succeed.
But copying them into Apache's ServerRoot, Apache's \bin\, Window's \System32\, or even worse into the Windows main directory is a bad hack and may not even work with newer PHP versions.
The right way to do it is to add the PHP path to the Windows Path variable.
In Control Panel -> System click on Advanced System Settings or press WIN+R and type SystemPropertiesAdvanced
Click the button Environment Variables.
Under System Variables you will find the Path variable. Edit it and prepend C:\PHP; to it - or whatever the path to your PHP folder is.
(Hint: If your PHP folder contains spaces like C:\Program Files\PHP you may need to use the short filename form here, i.e. C:\Progra~1\PHP.)
Then fully stop Apache and start it again (a simple restart might not be enough).
Update 2017-05:
I changed the instructions above to prepend the Path variable with the PHP path instead of appending to it. This makes sure that the DLLs in the PHP path are used and not any other (outdated) versions in other paths of the system.
Update 2018-04:
If you have already chosen the wrong way and copied any of the PHP DLLs to Apache or Windows paths, then I strongly recommend that you remove them again! If you don't, you might get into trouble when you later try to update PHP. If a new PHP version brings new versions of these DLLs, but your old DLLs still linger around in system or webserver paths, these old DLLs might be found first. This will most certainly prevent the PHP interpreter from starting. Such errors can be very hard to understand and resolve. So better clean up now and remove any of the mentioned DLLs from Windows and Apache paths, if you copied them there.
(Thanks to #EdmundTam and #WasimA. for pointing out this problem in the comments!)
Update 2019-10:
Tip: To find all copies of these DLLs and check whether you might have placed them in the wrong folders, you can use the following commands in a Windows Command Prompt window:
dir c:\libeay32.dll /s
dir c:\ssleay32.dll /s
Be warned that these commands may take some time to complete as they search through the entire directory structure of your system drive C:.
Update 2020-08:
If your PHP folder contains spaces (i.e. C:\Program Files\PHP) you may need to use the short filename form in the Path variable at step 3 (i.e. C:\Progra~1\PHP). Thanks to #onee for this tip!
In PHP 5.6.x version You should do the following:
Move to Windows\system32 folder DLLs from php folder:
libssh2.dll, ssleay32.dll, libeay32.dll and php_curl.dll from php ext folder
Move to Apache24\bin folder from php folder:
libssh2.dll
Also, don't forget to uncomment extension=php_curl.dll in php.ini
WINDOWS Apache 2.4.x + PHP 7.0.x SOLUTION HERE:
Solution: Put libeay32.dll, libssh2.dll, ssleay32.dll files under dir specified in httpd.conf's ServerRoot directive. These dlls can be found compiled under php root folder.
Reasons:
Problem is php_curl.dll requires to access following libraries while loading: libeay32.dll, libssh2.dll, ssleay32.dll and it does not make sense if you put them in ./php/ext dir or if you put PHP extensions in PHP root dir.
Of course you can put them in C:\Windows or in some global folder defined in PATH but if you don't want to do this and you want that your apache+php installation was portable:
The path specified in ServerRoot in httpd.conf is treated as home path for php. The behaviour is similar to situation where you include ./path/to/some.php file in ./index.php and home path for some.php file is still ./ the dir where index.php resides.
In shorts just put those three dlls right in dir you specified in httpd.conf ServerRoot directive and php_curl.dll will not fail to load again.
You are loading .dll so your OS has to be windows.
First check which php.ini file you are using by running phpinfo()
Then check where your extensions folder is by checking extension_dir attribute in that file.
Next make sure that php_curl.dll is present in that folder. If not copy it over.
Restart apache and check if it works.
Since you installed packages individually, also do this:
Copy the dll file from php_installation_folder/extensions to apache_installation_folder/bin
Usually this is an OpenSSL version mismatch error, between Apache and PHP. In case Apache loads PHP as a DSO module, its own OpenSSL versions (dlls and libs) will be used. So, in case the PHP extension requires a newer version, it may not find the appropriate interface inside the Apache-loaded DLLS and it will fail to work.
Since you need the PHP extension to load, you need the relevant DLL files to be at least the version of what the PHP module asks for.
Supposing that you 're using lastest builds for both Apache and PHP and both having been built with the same MVC version, you can copy the following files:
libcrypto-1_1.dll
libcrypto-1_1-x64.dll
libcurl.dll
libsasl.dll
libssh2.dll
libssl-1_1.dll
libssl-1_1-x64.dll
nghttp2.dll
libeay32.dll (if existing in your PHP distribution)
ssleay32.dll (if existing in your PHP distribution)
from the PHP root folder to the Apache2/bin folder, in case you 're confident that the PHP build is newer than the Apache build.
In the opposite case, you can copy the same files from the Apache BIN to the PHP root.
In any case, backup the contents of the APache and PHP folders beforehand.
Adding the PHP path as an enviromental variable will give priority to this path for loading the relevant DLLs and may solve the problem. However, you lose in server portability. Additionally, if you have also added the Apache PATH as a variable and the OpenSSL versions are way different (up to loading different linked DLL files), a lot of shit may happen.
Make sure to have your apache SSH dlls loading correctly. On a fresh install I had to download and load into my apache bin directory the following dll "libssh2.dll"
After ssl dll was loaded cURL was able to load with no issues.
You can download it from the link below:
http://windows.php.net/downloads/pecl/releases/ssh2/0.12/
Solution:
Step1: Uncomment the php_curl.dll from php.ini
Step2: Copy the following three files from php installed directory.i.e "C:\\php7".
libeay32.dll,
libssh2.dll,
ssleay32.dll
Step3: Paste the files under two place
httpd.conf's ServerRoot directive. i.e "C\Apache24"
apache bin directory. i.e "C\Apache24\bin"
Step4: Restart apache.
That's all. I solve the problem by this way.Hope it might work for you.
The solution is given here.
https://abcofcomputing.blogspot.com/2017/06/php7-unable-to-load-phpcurldll.html
After having tried everything here I had to simply upgrade Apache to a newer version in order to make curl extension work.
I was upgrading PHP from 7.0.2 to 7.1.15 after which curl did not work. Only way to fix it was upgrade Apache (which was version 2.4.18) to the latest 2.4.29.
Didn't have to copy any of the lib/ssleay dll files to either Apache or Windows - possibly because I already have the PHP folder in my system path.
Running Windows 10, 64-bit, thread-safe versions, VC14.
Insert to file httpd.conf
LoadFile "D:/DevKit/PHP7.1/libeay32.dll"
LoadFile "D:/DevKit/PHP7.1/libssh2.dll"
LoadFile "D:/DevKit/PHP7.1/ssleay32.dll"
In php.ini you must put the extension_dir static path. extension_dir = "C:\laragon\bin\php\php-7.3.11-Win32-VC15-x64\ext" by example. Don't forget to remove the semicolon before this variable.
I have encountered the same problem before.I resolved it by add php directory to windows system environment variables---Path.
I got this error because, on my system at least, if extension_dir in php.ini is set to a relative path, it is taken as being relative to the root Apache directory, so to get it to point to the correct directory I had to use an absolute path: "C:\Program Files (x86)\PHP\ext". (This was PHP 5.5.31 and Apache 2.4.23 on Windows 10; setting extension_dir to ext worked just fine with the same setup on Windows 7. I first got it to work by putting an ext directory in the Apache folder with the necessary dlls, then figured out what was happening.)
It was also necessary to set the PATH correctly or make sure the dlls mentioned above (libeay32.dll, libssh2.dll, and ssleay32.dll) are in Apache's bin directory (or most likely any of the places other answers mention). The fact that I got the same error message for Apache not being able to find lib_curl.dll as for it not being able to find libssh2.dll did not make things any easier to figure out.
Add your php folder path to the System PATH and everything should work fine. It will also fix some other extensions that are broken.
Maybe not the best approach, but it definitely works. (2019-2022)
"Your install of PHP does not have the 'php_curl.dll' extension enabled."
find "php.ini", if no you have to rename "php.ini-development" to "phh.ini". Open it.
find ;extension_dir = "ext"
add these under that line, there is no ";"
extension_dir = "[php dir]\ext"
extension=php_curl.dll

intl extension: installing php_intl.dll

I'm trying to locate php_intl.dll and install it.
Does anyone have any tips?
For the php_intl.dll extension to work correctly, you need to have the following files in a folder in your PATH:
icudt36.dll
icuin36.dll
icuio36.dll
icule36.dll
iculx36.dll
icutu36.dll
icuuc36.dll
By default they're sitting in your PHP directory, but that directory isn't necessarily in your PATH (it wasn't for me, using xampp)
This has to be in your global path, not just your user's path. To set the global path, go to system info (windows key + PAUSE), then Advanced System Settings (Vista+) or Advanced (XP) and click the "Environment Variables" button and add the appropriate directory to the PATH variable in the System Variables list.
The packages at http://windows.php.net/download/ all contain the php\_intl.dll which is located in the subdir ext/.
All you have to do is to check if your extension_dir points to the right directory and add (or uncomment) the extension=php\_intl.dll directive.
I have XAMPP 1.8.3-0 and PHP 5.5.0 installed.
1) edit php.ini:
from
;extension=php_intl.dll
to
extension=php_intl.dll
Note: After modification, need to save the file(php.ini) as well as need to restart the Apache Server.
2) Simply copy all icu* * * *.dll files:
from
C:\xampp\php
to
C:\xampp\apache\bin
Then intl extension works!!!
Had the same issue ... I found the files needed by searching my drive for icu**.dll and found the ones listed above but with 46 instead of 36 in the php folder. I copy pasted them to the apache/bin file and tried starting apache and it finally started. On the Server Checks page it has now changed from Yellow Check to Green OK. Hope this helps.
If you read error message, "icuuc36.dll" is missing.
The problem is that you don't have the PHP dir in your PATH, or you can copy all "intl" files from php directory to apache\bin directory.
They are :
icudt36.dll
icuin36.dll
icuio36.dll
icule36.dll
iculx36.dll
icutu36.dll
icuuc36.dll
The package is already included in the extensions for PHP 7.2 and above and you just need to uncomment the following line in php.ini
extension=intl
I resolved this issue by adding PHP directory to PATH variable.
I just appended ;C:\xampp\php to Path variable in Windows Environment Variables.
For WampServer 2.5 (Apache 2.4.9 and PHP 5.5.12):
In default I've had php_intl enabled (you can enable it when you left click on the wamp icon in the system tray > PHP > PHP extensions and check if is it marked)
To have it properly working, I've had to copy:
C:\wamp\bin\php\php5.5.12\icu**51.dll
(total 8 files)
to
C:\wamp\bin\apache\apache2.4.9\bin
Then just restart the wamp and everything was just fine.
You can type this command in terminal: sudo apt-get install php-intl
I have PHP 5.3.1 and Apache
When I add the extension=php_intl.dll to php.ini and restart apache, it comes an alert that says "the requested operation has failed"
And this error on Event Monitor:
Faulting application name: httpd.exe, version: 2.2.14.0, time stamp: 0x4ac181d6
Faulting module name: php5ts.dll, version: 5.3.1.0, time stamp: 0x4b051b35
Exception code: 0xc0000005
The problem was some DLLs like icudt36.dll were missing (noticed with sysinternals ProcMon), I've downloaded php 5.3.1 zip version and extract all DLL's to PHP folder. That solved the problem.
When I faced this issue it was sorted out by using below mentioned steps:
Edit php.ini:
Make
;extension=php_intl.dll
to
extension=php_intl.dll
Simply copy all icu* * * *.dll files(any icu file with dll extension) from
C:\xampp\php to C:\xampp\apache\bin
Also If you have the msvcp110.dll missing file error. You have to download the right .dll or just go here http://www.microsoft.com/es-es/download/confirmation.aspx?id=30679 and install the vcredist_x64.exe and vcredist_x86.exe.
Now the intl extension should work :-)
I have IIS 7 and installed PHP using Microsoft Web Platform Installer on Windows 7. In IIS, go to PHP Manager in settings main page -> PHP Extensions -> Enable or Disable an Extension.
Intl extension is disabled by default.
I hope this helps
If you have the msvcp110.dll missing file error. You have to download the right .dll or just go here http://www.microsoft.com/es-es/download/confirmation.aspx?id=30679 and install the vcredist_x64.exe and vcredist_x86.exe, it worked for me.
There is a better way of doing this.
I was having same kind of problem with ldap, intl, curl php extensions. I've solved those issues by the following ways:
At first you've to check whether these extensions have been enabled in the php.ini file by removing semicolon (;) in front of the following lines:
;extension=php_intl.dll
;extension=php_ldap.dll
;extension=php_curl.dll
Now you can directly load those necessary dll files (ie libeay32, libssh2, ssleay32, icu**.dll ) from your httpd.conf (apache configuratio file) file. You don't have to do any other things like copying them to the apache's bin directory or php's ext directory. Just add them directly in you apache's httpd.conf file.
Please note that the followng example is for php version 5.5.x.
LoadFile "C:/php/icudt51.dll"
LoadFile "C:/php/icuin51.dll"
LoadFile "C:/php/icuio51.dll"
LoadFile "C:/php/icule51.dll"
LoadFile "C:/php/iculx51.dll"
LoadFile "C:/php/icutest51.dll"
LoadFile "C:/php/icutu51.dll"
LoadFile "C:/php/icuuc51.dll"
LoadFile "C:/php/libeay32.dll"
LoadFile "C:/php/libssh2.dll"
LoadFile "C:/php/ssleay32.dll"
That's it. Now, restart your apache or wamp and you're good to go.
In my case adding PHP directory to PATH in user environment didn't work. After some testing I've found that it should be added to system PATH (I don't know what's the name of this part of system setting windows, 'couse I have Polish Windows).
/Digger here/
Moving the icu*****.dll files to /ext/ seems to resolve the issue as well.
( If you specified the extension directory to be there of course )
In my xampp control panel, Click config to open php.ini
remove ; in
;extension=php_intl.dll
Then restart the apache.
Under php extensions in your wampserver, ensure intl is checked
check your extension_dir in your php/v7.0/php file ensure the directory is not commented and it is accurate
(Dont know if this contributed but i did all three)In your extension list in the same file as 2 above, include the intl file in the same format as the rest(if it is not included).
All the best
I was having trouble getting intl to run using PHP 7.1.7 and PhpStorm on Windows 10. Based on other answers here I could tell it was a PATH/DLL dependency problem but I couldn't seem to find all of the required files even after (re-)installing the Visual C++ Redistributable.
I eventually went searching my C: drive for vcr*.dll and found a copy of vcruntime140.dll in my C:\Program Files\Mozilla Firefox directory. So, in addition to making these changes to php.ini:
extension_dir = "ext"
extension=php_intl.dll
I also set my runtime PATH to ONLY the PHP directory (in my case, C:\Program Files\PHP\7.1.7) and the Firefox directory (above) and it FINALLY worked! I know it needs more than just the vcruntime140.dll but the other required DLLs must be in the FF directory too (there are a few dozen but I didn't bother to figure out which ones are essential).
You have to modify the php.ini file by removing the semi-colon on the line containing
extension=php_intl.dll
After this, go to the php folder of Xamp or Wamp or EasyPHP, copy every dll file containing
icu*,
Paste them inside your windows file.
That worked for me.
Configuration : EasyPHP Dev Server, Windows 10.

Categories