I have a Centos 7 server running apache 2.4.6 and php 5.4. I'm trying to install Magento 2 on my server for a client but am having issues.
I need to have PHP 5.5 or 5.6 installed on my server for Magento 2 to run. I cannot figure out how to upgrade to PHP 5.5 or PHP 5.6.
I don't know the difference between the two versions, so I'll take whatever I can get working !
Thanks :)
This is the procedure for PHP 5.6.
I was able to upgrade PHP 5.4.16 on CENTOS7 to version 5.6.25 with these simple steps. Important to note that i used the Software Collection Repositories.
1- Install All these new packages:
yum install centos-release-scl
yum install rh-php56
yum install rh-php56-php
yum install rh-php56-php-pdo
yum install rh-php56-php-devel
yum install rh-php56-php-mysql
yum install rh-php56-php-fpm
2- Make apache 2.4 use php-fpm
Edit that file: /etc/httpd/conf.d/php.conf
Put that content:
<FilesMatch \.php$>
# SetHandler application/x-httpd-php
SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>
3- Reboot services to handle php-fpm:
systemctl restart rh-php56-php-fpm
systemctl restart httpd
4- Enabling rh-php56-php-fpm service on boot time
systemctl enable rh-php56-php-fpm
systemctl enable httpd
5- Create a symlink for the new php version.
mv /usr/bin/php /usr/bin/phpOLD
ln -s /opt/rh/rh-php56/root/bin/php /usr/bin/php
Run this in your terminal:
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm
Then :
sudo yum install php php-gd php-mysql php-mcrypt
and you should have php 5.5
This is the procedure for PHP 7.3
I was able to upgrade PHP 5.4.16 on CENTOS7 to version 7.3.11 with these simple steps. Important to note that i used the Software Collection Repositories.
1- install this alone
yum install centos-release-scl
2- then run this
yum install rh-php73
yum install rh-php73-php
yum install rh-php73-php-pdo
yum install rh-php73-php-devel
yum install rh-php73-php-mysqlnd
yum install rh-php73-php-fpm
3- Edit that file: /etc/httpd/conf.d/php.conf Put that content:
<FilesMatch \.php$>
# SetHandler application/x-httpd-php
SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>
4- Reboot services to handle php-fpm:
systemctl restart rh-php73-php-fpm
systemctl restart httpd
5- Enabling rh-php73-php-fpm service on boot time
systemctl enable rh-php73-php-fpm
systemctl enable httpd
6- Create a symlink for the new php version.
mv /usr/bin/php /usr/bin/phpOLD
ln -s /opt/rh/rh-php73/root/bin/php /usr/bin/php
Steps (Use sudo only if required)
1) Remove OLD Apache
sudo service httpd stop
sudo yum erase httpd httpd-tools apr apr-util
2) Remove OLD PHP
sudo yum remove php-*
if it´s a clean installation start from here:
3) Install PHP 5.6 (Apache 2.4 will be automatically installed with this)
sudo yum install php56
4) Make sure all the required PHP extensions are installed
yum list installed | grep php
5) If not then install them using
sudo yum install php56-xml php56-xmlrpc php56-soap php56-gd
6) To list the other available php extensions
yum search php56
7) PHP 5.6 MySQL extension (Assume you have already installed MySQL)
sudo yum install php56-mysqlnd
(NOTE: it is not php56-mysql)
8) Start / Restart Apache
sudo service httpd start
sudo service httpd restart
9) Check the version
php -v
httpd -v
Related
I am trying to install Microsoft ODBC Driver 17 for SQL Server, gcc-c++ and unixODBC-devel using .ebextensions with the below config file. When I try to create the environment with eb create from the command line, the environment goes to a state where I got no choice but to kill the environment. I can't even see the logs. Can anyone tell me why this is happening?
install_odbc.config file
commands:
010_install_odbc:
command: |
# Enable epel
sudo yum-config-manager --enable epel epel-source epel-debuginfo
# Install Microsoft ODBC Driver 17 for SQL Server
# Also disable "annoying" priorities plugin while installing
curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
sudo yum remove unixODBC-utf16 unixODBC-utf16-devel #to avoid conflicts
sudo ACCEPT_EULA=Y yum install --disableplugin=priorities -y msodbcsql17
# Insall gcc-c++ and unixODBC-devel
# Also disable "annoying" priorities plugin while installing
sudo yum install --disableplugin=priorities gcc-c++
sudo yum install --disableplugin=priorities unixODBC-devel
test: "! yum list installed unixODBC unixODBC-devel"
What is the best way of installing the apache superset in the secured server?
I haven't found any answer for it i figured it out with so many trial and error method, So its my small contribution to the community who are facing same issue
Below are the commands to install apache superset in production/Development
sudo yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel
sudo yum install python3
sudo yum install python3-devel
Since server has no internet you need to download it from below python community in your local system and transfer it to the server
Download all dependencies from :- https://pypi.org/simple/
To untar :- tar -xvf package.tar
Go to untared folder and run below command
sudo python3.x setup.py install x=your python version
If the package is of wheel extension i.e .whl run below command
sudo python3.6 -m pip install packagename.whl
After installing all the dependencies run below command
fabmanager create-admin --app superset
superset db upgrade
superset init
superset run -p port --with-threads --reload --debugger - For development
gunicorn -b IP:port superset:app --For production use
Hope this will help someone who is facing issue,
If there is any changes or i missed please add
I haven't seen any yum packages for php 7.2 on AWS EC2 and the release has been out over a month.
I have tried yum list | grep php7 and only able see php70 and php71 packages.
Has anyone installed php72 on AWS EC2?
Is there another yum repo to connect to?
Does AWS have a delivery scheduled?
Although the #amzn-main repo doesn't have PHP 7.2 yet (as far as I know), you can use remi-php72. According to his release blog you can install the EPEL and Remi repositories via:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm
rpm -Uvh epel-release-latest-6.noarch.rpm
And then enable remi-php72 using yum-config-manager:
yum install yum-utils
yum-config-manager --enable remi-php72
After that, you can simply search and install php and all the needed extensions like normal:
sudo yum install --disablerepo="*" --enablerepo="remi,remi-php72" php php-fpm php-cli ...
As #Typel says in a comment on the other answer - if you're using Amazon Linux 2 AMI then
sudo amazon-linux-extras install -y php7.2
Beats installing multiple external repos and has most of th basics, including mariadb and vim (everything I need to feel happy!).
See the list: sudo amazon-linux-extras list
I am looking for the python3 version of mod_wsgi for Centos 7.
I know that for fedora, it is python3-mod_wsgi and ubuntu is libapache2-mod-wsgi-py3. However, I am not able to find the equivalent for Centos 7. I need this package for my django website to run.
CentOS 7.3 does not have a package of mod_wsgi that is compiled against Python 3.
You can use pip to compile the module yourself:
sudo yum install httpd-devel gcc
pip install mod-wsgi
# Becoming root makes it easier to echo to a file in /etc/httpd
sudo -i
echo "LoadModule wsgi_module [path-to-your-virtual-environment]/lib/python3.4/site-packages/mod_wsgi/server/mod_wsgi-py34.cpython-34m.so" > /etc/httpd/conf.modules.d/00-wsgi.conf
exit
sudo systemctl restart httpd
How to install xsendfile for httpd 2.4 on amazon linux ami? Default package repositories from amazon and epel do not have a package for httpd 2.4, only for httpd 2.2. I would prefer not to compile the module if possible. Thank you.
I'm not aware of a quick Yum/apt-get style install for X-sendfile for Apache24 on an EC2 instance at the time of writing this answer, however compiling and installing the module your self is super easy:
Prepwork
Download mod_xsendfile.c from download section the link below
https://tn123.org/mod_xsendfile/
Install GCC for compiling
sudo yum install gcc
We need httpd24-devel for apxs
sudo yum install httpd24-devel.x86_64
Compiling and installation
sudo apxs -cia mod_xsendfile.c
Edit your http.conf add
<IfModule mod_xsendfile.c>
XSendFile on
XSendFilePath /home/path/to/private/files/to/serve/
</IfModule>
Restart Apache24
sudo service httpd restart
Done !
Check your phpinfo or apache_modules() to confirm all good and modify settings to your liking.
Enjoy efficient downloads :)