How to install Xdebug on PhpStorm Apache 2 PHP 7.4 - phpstorm

I've installed Xdebug and setup by this instruction:
Install Xdebug PHP:
sudo apt-get update -y
sudo apt-get install -y php7.4-xdebug
Find xdebug.so, then add the first one to php.ini:
sudo updatedb
locate xdebug.so
locate php.ini
Config php.ini:
sudo gedit /etc/php/7.4/apache2/php.ini
Then restart Apache web server:
sudo service apache2 restart
PhpStorm settings and code:
Result and Xdebug Chrome extension enabled:
Did I miss anything? This setting works fine for me in PHP 7.2 and bellow but now on PHP 7.4 and it's not working any more.

For PHP 7.4 you need xdebug.so with 20190902 in the path.
You can check that from phpinfo() output: and you will see the PHP API version there, at the very top:
PHP 7.4:
...
PHP API => 20190902
PHP Extension => 20190902
Zend Extension => 320190902
...
PHP 7.2:
...
PHP API => 20170718
PHP Extension => 20170718
Zend Extension => 320170718
...
Your 20131226 is for PHP 5.6.
You have to use extensions that were compiled to use the same API version.
So double check phpinfo() output: you need to confirm that right API version is used + that Xdebug is actually loaded and enabled (use xdebug_info() for Xdebug v3; for Xdebug v2 you will have to check dedicated Xdebug section from phpinfo() output).

Related

Wordpress shows a blank white page during installation

I am trying to make a WordPress installation on Ubuntu 20.04. I have the LAMP(Linux, Apache, MySQL & PHP) stack installed but I don't understand why when i load the localhost folder, asin localhost/wordpress,the result is just a white background. Any solutions?
Clean your cache and increase PHP memory limit to aleast 96MB-128MB
I just found the solution. The problem was that I forgot to install PHP while setting up my LAMP stack.
So I just run:
sudo apt install php libapache2-mod-php php-mysql to install PHP and other needed modules.
To check PHP version installed, run:
php -v

Installing Siremis stuck on Database Configuration

I have install Kamailio 4.3.4 on Ubuntu 16.0.5 LTS. I want to install Siremis 4.3.0 but stuck on Wizard step 2 (Database Configuration) there is message "Something went wrong". I found error 500 action=update on console inspect element. I have try installing Siremis 5.1.0 and still not working stuck on step 2.
My Apache ver 2.4.10, My Php ver 7.0.33, Mysql 14.14
Please any advise
Sounds like one of the dependencies is not met:
Check your permissions are set:
make prepare24
make chown
Check Mod Rewrite is enabled:
a2enmod rewrite
service apache2 reload
Check PHP Mod is Enabled in Apache
On 16.04 installing PHP doesn't automatically add the PHP Apache mod, should be a package like libapache2-mod-php, you can verify that Apache is actually parsing PHP files by setting up a PhpInfo page.
Remove the Lock File & Try Again
When you run the installer a lockfile is created to prevent running the installer multiple times.
Once we empty the database with:
mysql> drop database siremis;
We can remove the lockfile and try again (from the Siremis directory):
rm install.lock
I did a writeup on installing Siremis on Ubuntu 18.04 which works fine.

How to set PHP_IDE_CONFIG while debugging PHP CLI using PhpStorm

I've configured Xdebug and PhpStorm properly, and have used Browser Debugging Extensions and successfully tested a PHP CLI server LaravelFly which speeds up Laravel.
sudo php /vagrant/www/zc/vendor/scil/laravel-fly/bin/fly start
But I failed to test it using PHPUnit today:
sudo php -dxdebug.remote_host=192.168.1.108 vendor/bin/phpunit --stop-on-failure
I added this to Vagrant Ubuntu .zshrc
export PHP_IDE_CONFIG="serverName=zc.test"
but it still does not work and PhpStorm response the same error messag.
In the picture above, I found that $_SERVER['PATH'] is not same with the $PATH of my vagrant user, then I got it.
I removded sudo
php -dxdebug.remote_host=192.168.1.108 vendor/bin/phpunit --stop-on-failure
Now it works!

How do I enable the intl extension in CakePHP?

I am using CakePHP 3 and MAMP Pro server for my project. When I am trying to bake the cake, this error shows up:
Fatal error: You must enable the intl extension to use CakePHP.
I have even included intl.so and extension=php_intl.dll in my php.ini file but couldn't figure out solution for this error.
this issue was happening to me some days ago. I had installed Ubuntu 18.04 and php 7.1.
I was trying to run the comman php cake.php bake in orden to use cakephp's console but I was getting the following error message:
You must enable the intl extension to use CakePHP.
This extension (intl) was installed for php 7.1 (php7.1-intl) but this message was appearing every time I used php cake.php bake
After some google searches, I saw that I have to install the extension but with the following command:
sudo apt-get install php-intl
The same issue happened with mbstring extension, I used the command:
sudo apt-get install php-mbstring
then I restarted the apache server with:
sudo service apache2 restart
It's difficult to pinpoint exactly what's wrong without seeing your system setup. However based on what was said in the question, you may be setting up the intl extension incorrectly.
First off, if your OS is Linux/macOS and the PHP extension is a shared library (i.e. has a .so extension) then the php.ini entry should be extension=intl.so not extension=php_intl.dll. Also make sure the intl.so file is in the directory configured under the ini entry extension_dir. Otherwise make sure the extension ini entry is fully qualified (e.g. extension=/path/to/extension/dir/intl.so).
If you are using a Linux OS that has a package manager such as Debian/Ubuntu, you may be able to more easily install the extension for the PHP packaged for that distro. For example, in Ubuntu/Debian the package php5-intl provides the intl extension for PHP5 (I assume it's something similar for PHP7 if you've enabled those repos).
If you build PHP from source, you can try bundling the extension into your PHP. See the instructions from the manual.
I faced the same issue.
I added extension="php_intl.dll" in php.ini and restarted the Apache server.
Now it is working.
I had the same issue. After starting from scratch, I did :
$ brew install php
$ composer install && composer update && composer dump-autoload --optimize
$ composer self-update && composer create-project --prefer-dist cakephp/app:^3.8 cms
$ cd cms
$ bin/cake server
And it was working !

unable to configure phpstorm 9 debug on mac

I am trying to configure phpstorm debug. My php files from my remote server which is on example.com have GET calls and its not working .I have installed chrome extension but when I try to debug php on chrome .Nothing happens. The path where phpstorm in local/bin/php and xdebug is installed in /usr/local/etc/php/5.5 . Under Interpreters /usr/bin/php : php version is 5.5.27 and debugger is not installed.But when I enter php --version in terminal I get :
Zend Engine v2.5.0,
with Xdebug v2.3.3,
I have installed MAMP pro and have added /Applications/MAMP/bin/php/php5.5.10/bin/php in PHP Interpreter .I can see xdebug 2.2.4 .But I would like to debug single php on server not php-webapp. How can I do that?
I am trying to configure it for more than a day but it's not working.I really appreciate any help.