- Zend Extension For Php 7 Not Working Os X 1
- Php 7 Download
- Zend Extension For Php 7 Not Working Os X 8
- Php 7 Tutorial
Problem
On differences between PHP and Zend extensions¶. Into PHP’s source code, PHP extensions are named as “PHP modules”, whereas Zend extensions are called “Zend extensions”. So into PHP’s heart, if you read the “extension” keyword, you should first think about a Zend extension.
PHP packages/frameworks/libraries/scripts we work with might require different PHP extensions. In this case the Intl extension is needed to work with using Internationalization Functions.
Got any of these error messages?
- Zend InputFilter requires intl PHP extension
- The requested PHP extension intl is missing from your system
This happened because the PHP Intl extension isn’t installed or enabled.
Parts of this tutorial can be also a guide for installing or enabling other extensions.
What is PHP Intl?
Internationalization extension (further is referred as Intl) is a wrapper for » ICU library, enabling PHP programmers to perform various locale-aware operations including but not limited to formatting, transliteration, encoding conversion, calendar operations
Source: PHP Documentation
This extension may be installed using the bundled version as of PHP 5.3.0, or as a PECL extension as of PHP 5.2.0. In other words, there are two methods to install the intl extension.
Source: PHP Documentation
Cause
If you have installed the unbundled PHP version, the extension is not installed on the system. (unless you’ve installed it separately)
Zend Extension For Php 7 Not Working Os X 1
If you have the bundled PHP version, the extension might be existing but not enabled.
Solutions
For Linux-based Server (assuming you have root access):
- Make sure the php_intl.so file exists within your php extensions directory, find the extensions directory by:
- using phpinfo()
- running this command:
php -r 'echo ini_get('extension_dir');'
- (note: both options gets the extension_dir right from the PHP runtime configuration)
- If the file exists:
- search for the config file (php.ini, usually /etc/php.ini) and open it
- Make sure the line “extension=php_intl.so” is existing and not commented
- Restart the web server (usually sudo service httpd restart)
- Check if the extension is enabled using phpinfo()
- If the file doesn’t exist
- Check your php version by running the “php -v” command
- For PHP 5 install the php-intl package using your package manager – package managers and commands
- Most common: apt-get install php-intl (for ubuntu-based linux) or yum install php-intl (for CentOS)
- For PHP 7, install the php7.x-intl (depending on your php version)
- Repeat the steps for the case in which the file exists
For projects hosted on a shared hosting platform you must ask your hosting provider to install/enable the PHP Intl extension.
For Windows-based Server:
- Make sure the php_intl.dll file exists within your php extensions directory
- for separately installed PHP: C:pathtophpext
- for xampp: C:pathtoxamppphpext
- (note: your drive letter might be different)
- If the file exists:
- search for the config file (php.ini, usually in the same folder as the php executable) and open it
- Make sure the line “extension=php_intl.dll” is existing and not commented
- Restart the web server (usually apache)
- Check if the extension is enabled using phpinfo()
- If the file doesn’t exist:
- Check your php version by running the “php -v” command
- Download the PHP version that corresponds to yours from the PHP Downloads Page (TS/NTS, x86/x64)
- To find thread safety for php, run: php -i | findstr “Thread” , source & more info.
- To find thread safety for php, run: php -i | findstr “Thread” , source & more info.
- Search for the php_intl.dll file in the ext folder in that version and copy it in your phpext folder
- Repeat the steps for the case in which the file exists
Edit: changed php7.0 occurrences with php7.x as the version may vary.
This section describes on how to install Xdebug.
Installing on Linux & Macs
You can install Xdebug through PECL on Linux & macOS1.You can installXdebug with PECL with:
When that is done, you still need to add the correct line to your php.ini
: (don't forget tochange the path and filename to the correct one — but make sure you usethe full path):
Note: You should ignore any prompts to add'extension=xdebug.so'
tophp.ini
— this will cause problems.
Installing on Windows
There are a few precompiled modules for Windows, they are all for the non-debugversion of PHP. You can get those at the downloadpage. Follow these instructions to get Xdebuginstalled.
Installation From Source
Obtain
You can download the source of the latest stable release 2.9.6.
Alternatively you can obtain Xdebug from GIT:
This will checkout the latest development version which is currently 3.0.0dev.You can also browse the source at https://github.com/xdebug/xdebug.
Compile
There is a wizard available that provides youwith the correct file to download, and which paths to use.
Php 7 Download
You compile Xdebug separately from the rest of PHP. You need access to thescripts phpize
and php-config
. If your systemdoes not have phpize
and php-config
, you willneed to install the PHP development headers.
Debian users can do that with:
And RedHat and Fedora users with:
It is important that the source version matches the installed version as thereare slight, but important, differences between PHP versions. Once you haveaccess to phpize
and php-config
, take thefollowing steps:
Zend Extension For Php 7 Not Working Os X 8
Php 7 Tutorial
Unpack the tarball:
tar -xzf xdebug-2.9.6.tgz
You should notunpack the tarball inside the PHP source code tree.Xdebug is compiled separately, all by itself, as stated above.
cd xdebug-2.9.6
phpize
If phpize is not in your path, please make surethat it is by expanding the
PATH
environment variable. Make sureyou use the phpize that belongs to the PHP version that you want to use Xdebugwith. See this FAQ entry if you're having someissues with finding which phpize to use../configure --enable-xdebug
make
make install
Configure PHP
Add the following line to
php.ini
:zend_extension='/wherever/you/put/it/xdebug.so'
Note: If you want to use Xdebug and OPCache together, youmust have the
zend_extension
line for Xdebug after the line forOPCache. Otherwise, they won't work properly.Restart your webserver.
Create a PHP page that has
phpinfo()
. Load it in a browser andlook for the info on the Xdebug module. If you see it next to the Zend logo,you have been successful!On the command line, you can also
php -m
. This lists all loadedmodules. Xdebug should appear twice there (once under 'PHP Modules' and onceunder 'Zend Modules').
With Xdebug loaded, you can now enable individual features, such asStep Debugging, or Profiling PHP Scripts.
1 On macOS, you should have PHP installed with Homebrew.