How can I use xdebug 3.0 with PHP 7.3 or 7.4 in DDEV? - ddev

DDEV-Local v1.16.2 ships with xdebug 3.0 as the xdebug version for PHP8.0 (as of Dec 2020, DDEV-Local v1.16), but I'd like to try out xdebug 3.0 with PHP7.3 or 7.4. How could I do that?
EDIT 2020-12-13: DDEV-Local v1.16.3 ships with Xdebug 3.0.1 as the Xdebug version for PHP7.2/3/4 and PHP8.0

EDIT 2020-12-13: DDEV-Local v1.16.3 ships with Xdebug 3.0.1 as the Xdebug version for PHP7.2/3/4 and PHP8.0, so you don't have to do anything at all!
DDEV-Local depends on the deb.sury.org Debian packages for PHP, so will follow those as the changes are made. Currently deb.sury.org packages PHP8.0 with xdebug 3.0, but it's not hard to get xdebug 3.0 with earlier PHP versions until that changes.
You can compile and install xdebug 3.0 for PHP7.3 or 7.4. Place this file as .ddev/web-build/Dockerfile in your project's .ddev directory:
ARG BASE_IMAGE
FROM $BASE_IMAGE
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confold" --no-install-recommends --no-install-suggests php-dev php-pear build-essential
RUN pecl install xdebug
RUN cp /etc/php/8.0/mods-available/xdebug.ini /etc/php/7.4/mods-available/xdebug.ini
RUN cp /etc/php/8.0/mods-available/xdebug.ini /etc/php/7.3/mods-available/xdebug.ini

Related

How to solve Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2"

After uploading my Laravel version 8.5 files. I keep getting this display instead of the landing page:
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2".
I've run the following commands:
a2dismod php7.4
a2enmod php8.1
service apache2 restart
update-alternatives --set php /usr/bin/php8.1
update-alternatives --set phar /usr/bin/phar8.1
update-alternatives --set phar.phar /usr/bin/phar.phar8.1
I've also restarted Apache with:
/etc/init.d/apache2 restart
But I keep getting the same display, even after clearing my browser cache.
I'm sure Apache is still referencing the former PHP version according to:
phpinfo()
Full Disclosure:
I'm not proficient with Linux. My OS is Ubuntu 20.04, while my old PHP version is 7.4.29 and new PHP version is 8.1
Had the same issue. Found that there were multiple versions of php installed and Apache was referencing one of the former PHP versions. Disabled each former version using a2dismod until the right version was being referenced. Hope this helps.
Try to update your php version in your composer.json file.
"require": {
"php": "^8.0.2"
}
and then run composer update.
I don't think it's your PHP that's the problem. I think it is your Composer configuration. Composer is the link between your PHP and your apps. See How to solve Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2"

The specified module could not be found.)) in Unknown on line 0

I am new to Laravel. I want to composer install the code but I get the error. Does anyone know how to solve it?
Problem 1
- Root composer.json requires php-mime-mail-parser/php-mime-mail-parser ^7.0 -> satisfiable by php-mime-mail-parser/php-mime-mail-parser[7.0.0].
- php-mime-mail-parser/php-mime-mail-parser 7.0.0 requires ext-mailparse * -> it is missing from your system. Install or enable PHP's mailparse extension.
To enable extensions, verify that they are enabled in your .ini files:
- D:\wamp64\bin\php\php7.3.21\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
The mailparse extension does not yet support PHP 7.3 or 7.4.
You need change your PHP version
https://serverpilot.io/docs/how-to-install-the-php-mailparse-extension/
Install Mailparse on PHP 7.0, 7.1, or 7.2
To install this extension on PHP 7.X, SSH in to your server as root and run the following commands:
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo pecl7.X-sp install --nodeps mailparse
sudo bash -c "echo extension=mailparse.so > /etc/php7.X-sp/conf.d/mailparse.ini"
sudo service php7.X-fpm-sp restart

Linode Ubuntu 16 for PHP 5?

I was trying to install PHP 5.x on Linode, but I got error:
E: Package 'php5-fpm' has no installation candidate
The command line is
sudo apt-get install php5-fpm
This issue has nothing to do with Linode. If you're running Ubuntu 16.04 (not 16) on Linode or anywhere else, PHP 5 no longer is available as they have moved on to PHP 7. If you can, I'd suggest using PHP 7. If not, this answer as details on how you can install PHP 5 from a PPA for use on Ubuntu 16.04: https://askubuntu.com/a/756901/51244
Ubuntu 16.04 has php 7 installed as default.
Change php version in your command. Here is updated command
sudo apt-get install php7.0-fpm
Note php7.0 in command.

CentOS 6.5 - How to upgrade HAProxy?

Can someone tell me how to upgrade HAProxy from 1.5.4 version to the latest version?
I'm using a virtual machine CentOS 6.5.
Thanks a lot ;)
HAProxy up to 1.5.4 is available for Centos via the package repository, so to get a newer version you will have to compile from source.
To upgrade to the latest version, you could follow these instructions to make your own installable package.
In summary:
sudo yum install rpmdevtools pcre-devel
rpmdev-setuptree
sudo yum groupinstall 'Development Tools'
sudo yum install openssl-devel
wget http://www.haproxy.org/download/1.6/src/haproxy-1.6.9.tar.gz
mv haproxy-1.6.9.tar.gz ~/rpmbuild/SOURCES/
git clone git://github.com/bluerail/haproxy-centos.git
cp haproxy-centos/conf/* ~/rpmbuild/SOURCES/
cp haproxy-centos/spec/* ~/rpmbuild/SPECS/
cd ~/rpmbuild/
rpmbuild -ba SPECS/haproxy.spec
The RPM should be available in ~/rpmbuild/RPMS/x86_64. You can install it like:
sudo rpm -Uvh RPMS/x86_64/haproxy-1.6-9.x86_64.rpm
Try the following yum command:
yum update haproxy
According to a quick repo search, this should update to HAProxy 1.5.4. Prove the version change with:
haproxy -v

Mcrypt PHP extension required on Mac OS X

I keep getting this error
Mcrypt PHP extension required
at the bottom after I run a composer update :
Since I am using Mac, I have tried running :
brew search mcrypt
brew install php56-mcrypt
I still get the same error message.
Steps
I solved this by running the following commands
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54-mcrypt
php --version // To Test your php
sudo composer update
Result
No more Mcrypt warning !!
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Generating optimized class loader
After update brew:
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
If you have installed php5.6 (or higher), you can use the following command to find out what versions are available in brew:
$ brew search mcrypt
homebrew/php/php53-mcrypt homebrew/php/php55-mcrypt homebrew/php/php70-mcrypt mcrypt
homebrew/php/php54-mcrypt homebrew/php/php56-mcrypt homebrew/php/php71-mcrypt
In my case, I am using php7.0:
$ brew install php70-mcrypt
On macOS High Sierra I did this steps:
1- Search the package:
brew search mcrypt
Result:
==> Searching local taps... homebrew/php/php71-mcrypt mcrypt homebrew/php/php53-mcrypt
homebrew/php/php54-mcrypt homebrew/php/php55-mcrypt
homebrew/php/php56-mcrypt homebrew/php/php70-mcrypt
libtomcrypt
2- Search my php version to know what can I need to install:
php --version
Result:
PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS ) Copyright (c)
1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017
Zend Technologies
3- Install the correct package, for me was 7.1.7 => homebrew/php/php71-mcrypt
brew install homebrew/php/php71-mcrypt
4- Find the find "mcrypt.so" extension file
find /usr/ -type f -name "mcrypt.so"
Result:
find:
/usr//local/Cellar/php71-mcrypt/7.1.13_19/mcrypt.so
5- Search the php.ini
php -i | grep 'Configuration File'
Result (if exist):
Configuration File (php.ini) Path => /etc Loaded Configuration File =>
/etc/php.ini
6- Add the next line at the end on /etc/php.ini (see the last step your correct path) the extension mcrypt.so
extension=/usr/local/Cellar/php71-mcrypt/7.1.13_19/mcrypt.so
Finish, you can now execute your command.
You'll need to add the line
extension=mcrypt.so
In your phi.ini file responsible for the CLI PHP version.
To find where it is, run:
php -i | grep 'Configuration File'
In use XAMPP on my Mac, so I had to install php and then compile mcrypt using pecl, after that I copied mcrypt.so to XAMPP.
The actual list of available releases is: http://pecl.php.net/package/mcrypt
The commands was:
echo Install php...
brew install php
/usr/local/opt/php/bin/php -v
echo Correction of "error Connection to `ssl://pecl.php.net:443' failed"...
wget http://curl.haxx.se/ca/cacert.pem
sudo cp cacert.pem /private/etc/ssl/cert.pem
sudo mv cacert.pem /Applications/XAMPP/xamppfiles/share/openssl/cert.pem
/usr/local/opt/php/bin/pecl list-all
echo Compile and Install mcrypt.so...
sudo /usr/local/opt/php/bin/pecl install mcrypt-1.0.1
The last message of build process of pecl was:
Build process completed successfully
Installing '/usr/local/Cellar/php/7.2.7/pecl/20170718/mcrypt.so'
install ok: channel://pecl.php.net/mcrypt-1.0.1
Extension mcrypt enabled in php.ini
Based on path of build process I copied the compiled mcrypt.so to XAMPP and enable the extension on php.ini:
sudo cp /usr/local/Cellar/php/7.2.7/pecl/20170718/mcrypt.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20170718/mcrypt.so
echo 'extension=mcrypt.so' >> /Applications/XAMPP/xamppfiles/etc/php.ini
Check if it works:
/Applications/XAMPP/bin/php -i | grep "mcrypt"
The result have to be:
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
Remember to restart Apache to see it working using browser.
Maybe it helps someone and I win one thumbs up. Thanks
if you using brew try this :
1.Unistall existing php then Install shivammathur/php
add shivammathur php
brew tap shivammathur/php
change php version with you needed (5.6 or 7.2 or 7.4 or 8.1 or next version)
brew install shivammathur/php/php#8.1
2.Install shivammathur/extensions it s will add extension to php
then
brew tap shivammathur/extensions
brew install shivammathur/extensions/mcrypt#8.1
then you install mcrypt with same version as php version
brew install mcrypt#8.1
then restart httpd
brew services restart httpd
Ref :
https://github.com/shivammathur/homebrew-php
https://github.com/shivammathur/homebrew-extensions

Resources