PHP

From DikapediaV2
Jump to: navigation, search

How to Install php7 on RHEL 7



These instructions worked specifically for installing php7.2 on RHEL 7.6:

yum update
yum install wget
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm  
rpm -ivh epel-release-latest-7.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install php72
php72 -v


ttps://bobcares.com/blog/phpmyadmin-403-forbidden-error/

https://stackoverflow.com/questions/26762590/you-dont-have-permission-to-access-phpmyadmin-on-this-server-in-centos7-vps-se

https://linuxtogether.org/amazon-rds-mysql-instance-integration-with-phpmyadmin/

https://medium.com/coding-cheatsheet/how-to-using-phpmyadmin-to-administer-amazon-rds-e2019aec1251


PHP Fatal Error: Allowed memory size of...


The application is trying to use more memory than what PHP was configured to allow.

PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted tried to allocate 135168 bytes) in /var/www/html/prod-05-19-2020-phoenix/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 108 


To address this issue, Modify settings in /etc/php.ini andincreased the memory limits for PHP. Sometimes you may also have to do it in Wordpress also if you continue to get the errors.

To modify the PHP memory limit, we ran the following command:

$ sudo vi /opt/bitnami/php/etc/php.ini

# Modified the following line
memory_limit = 256M

I f you're still getting php memory exhaustion errors, you will need to edit the memory limit in WordPress 'wp-config.php' [4]. To adjust the memory limit in WordPress:

$ sudo vi /opt/bitnami/apps/wordpress/htdocs/wp-config.php

#  Added the following line
define( 'WP_MEMORY_LIMIT', '256M' ); 

Then we restarted the Bitnami stack:

 $ sudo /opt/bitnami/ctlscript.sh restart

This resolved the memory errors we saw in the apache logs in 8261.


ADD THESE NOTES: https://docs.presscustomizr.com/article/333-how-to-fix-the-link-you-followed-has-expired-in-wordpress

Preferably to the following values.

memory_limit = 256
upload_max_size = 64M
post_max_size = 64M  #sometimes you have to change this along with upload_max_size
upload_max_filesize = 64M
max_execution_time = 300
max_input_time = 1000


[1] 'Allowed memory size exhausted' error message in PHP https://www.a2hosting.com/kb/developer-corner/php/allowed-memory-size-exhausted-error-message-in-php

[2] Fixing PHP Fatal error: Allowed memory size of (X) bytes exhausted. https://thisinterestsme.com/fix-fatal-memory-bytes-exhausted/

[3] Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted (CodeIgniter + XML-RPC) https://stackoverflow.com/questions/561066/fatal-error-allowed-memory-size-of-134217728-bytes-exhausted-codeigniter-xml

[4] https://www.ecenica.com/support/answer/how-to-increase-wordpress-memory-limit/


Optimizing PHP-fpm


https://geekflare.com/php-fpm-optimization/