简体   繁体   中英

PHP Install Amazon Linux Cloud Formation

I want to upgrade from php 7.1 to 7.3 so I am trying to update the cloud formation script however I am having trouble with some of the packages.

The original script was:

"yum": {
               "awslogs": [],
               "nginx": [],
               "php71-fpm": [],
               "php71-mcrypt": [], 
               "php71-common": [],
               "php71-pdo": [],
               "php71-mysqlnd": [],  
               "php71-pecl-imagick": [], 
               "php71-gd": [],
               "cronie": []
    }

And the new script is:

"yum": {
               "awslogs": [],
               "nginx": [],
               "php73-fpm": [],
               "php73-mcrypt": [], 
               "php73-common": [],
               "php73-pdo": [],
               "php73-mysqlnd": [],  
               "php73-pecl-imagick": [], 
               "php73-gd": [],
               "cronie": []
    }

I thought this should be a simply change however I am receiving errors on the following extensions:

No package php73-mcrypt available.
No package php73-pecl-imagick available.

I am not sure how to get these two packages/extensions installed and why the command would be different?

Taken from here: https://askubuntu.com/questions/1031921/php-mcrypt-package-missing-in-ubuntu-server-18-04-lts

Mcrypt has been deprecated in PHP 7.2, so it's not available by default.

You can still install the mcrypt extension using pecl. These instructions are for the apache web server.

# Install prerequisites
sudo apt-get install php-dev libmcrypt-dev gcc make autoconf libc-dev pkg-config

# Compile mcrypt extension
sudo pecl install mcrypt-1.0.1
# Just press enter when it asks about libmcrypt prefix

# Enable extension for apache
echo "extension=mcrypt.so" | sudo tee -a /etc/php/7.2/apache2/conf.d/mcrypt.ini

# Restart apache
sudo service apache2 restart
That should get you going.

In the long term you might want to replace mcrypt, it's deprecated for a reason.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM