Laravel 5.3 Homestead php7 reload php.ini file - php

I made some changes to /etc/php/7.0/cli/php.ini on my laravel homestead machine. But I can't get it to load the new settings. Tried restarting nginx, restart php7, etc...

The file /etc/php/7.0/cli/php.ini is for PHP-running trough commandline.
There should a php.ini in /etc/php/7.0/fpm with the settings for PHP-FPM. After you've edited that, restart php-fpm with this command
service php7.0-fpm restart

I'm also running Homestead but a more recent version, for me it was the following:
service php7.1-fpm restart

Related

Why doesn't the php.ini file change in laradock?

Installed docker, docker-compose and laradock.
Changed settings in nginx and /etc/hosts.
The site is open and the flight is normal.
I just noticed that the error display does not work. Then I found out that it was necessary to register display_errors On in php.ini.
In my .env version of php 7.2 In laradock, in the file /home/serii/Web/laradock/php-fpm/php7.2.ini, changed the display_errors setting to On.
Then I run sudo docker-compose down and rebuild for php-fpm sudo docker-compose build worker php-fpm
Then sudo service apache2 stop && sudo docker-compose up -d nginx php-fpm mysql workspace
In workspace, php.ini is in /etc/php/7.2/cli/php.ini
And there display_errors Off.
Only for some reason php.ini in phpinfo () is located in a different path, but such path does not exist in workspace.
I've been rummaging in the net for half a day and can't find a clear answer.
Thanks in advance.
Because the laravel.ini doesn't reload. you will find some configuration saved in laravel.ini you have to force recreate to reload it
docker-compose up -d --force-recreate --build php-fpm

CentOS Linux release 8.0.1905 not taking change of php.ini

I want to remove output_buffering and want to make change to memory_limit by editing etc/php.ini file
But none of my changes are taking effect.
After editing etc/php.ini file as a super user. I've restarted httpd.service using following command
sudo systemctl restart httpd.service
I am using centOS 8
[root#backend adminuser]# cat /etc/*release
CentOS Linux release 8.0.1905 (Core)
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"
CentOS Linux release 8.0.1905 (Core)
CentOS Linux release 8.0.1905 (Core)
php-common packages are as below
[root#backend adminuser]# rpm -qc php-common
/etc/php-zts.d/20-bz2.ini
/etc/php-zts.d/20-calendar.ini
/etc/php-zts.d/20-ctype.ini
/etc/php-zts.d/20-curl.ini
/etc/php-zts.d/20-exif.ini
/etc/php-zts.d/20-fileinfo.ini
/etc/php-zts.d/20-ftp.ini
/etc/php-zts.d/20-gettext.ini
/etc/php-zts.d/20-iconv.ini
/etc/php-zts.d/20-phar.ini
/etc/php-zts.d/20-sockets.ini
/etc/php-zts.d/20-tokenizer.ini
/etc/php.d/20-bz2.ini
/etc/php.d/20-calendar.ini
/etc/php.d/20-ctype.ini
/etc/php.d/20-curl.ini
/etc/php.d/20-exif.ini
/etc/php.d/20-fileinfo.ini
/etc/php.d/20-ftp.ini
/etc/php.d/20-gettext.ini
/etc/php.d/20-iconv.ini
/etc/php.d/20-phar.ini
/etc/php.d/20-sockets.ini
/etc/php.d/20-tokenizer.ini
/etc/php.ini
For SSE Script I want to make output_buffer as null or Off like my another server but its not taking any change. I tested by changing php.ini as a root user and restarted httpd services.
I am assuming you are using php-fpm
Following command worked for me.
Connect via terminal and Make sure you are Super(Root) user
sudo su
Now run following command
sudo systemctl restart php-fpm.service
Note : Test by making small change like increasing or decreasing memory_limit in php config file and run above command and review change using phpinfo()
You don't mention whether you're using mod_php or php-fpm. Running sudo systemctl restart httpd.service only helps for mod_php. If you're using php-fpm, you need sudo systemctl restart php-fpm.service instead.
Changing etc/php.ini does not work any more.
You need to add your own .ini file now under "/etc/php.d" and restart php
confirm the path from phpinfo. Look for
"Scan this dir for additional .ini files /etc/php.d"
create file (30 prefix to file name is like priority or how late to load):
sudo vi /etc/php.d/30-user.ini
Add entries like:
max_execution_time=200
post_max_size=100M
upload_max_filesize=100M
Restart PHP (restarting Apache does not help)
Check the service (if not present ..restarting Apache should work: sudo systemctl restart httpd )
sudo systemctl status php-fpm
Resart the service
sudo systemctl restart php-fpm

Change apache2 php path

I am using https://github.com/wilmoore/php-version to switch between php versions on my local machine, installed within ~/php/versions. Currently setting up separate VMs with different versions of php installed is not an option.
When I switch php version through the command line using the linked tool, I see it listed as php 7. This also works when using php -v. I have restarted terminal and the machine and it still says php 7.
I have updated composer.json to require php 7.0.2 and greater. Yet when I use phpinfo() in my laravel application, it always states the default PHP Version 5.5.9-1ubuntu4.14.
Where is laravel pointing to the php distribution in my Ubuntu 14.04.3 machine and where can I change this path?
EDIT: I am using Apache. I can see in the phpinfo() output that it is reading the ini file from /etc/php5/apache2/php.ini. I have looked in this file but cannot see where to point to the php distribution.
first make sure that php7.*.conf and php7.*.load files are exist in /etc/apache2/mods-available directory.
then use sudo a2enmod php7.* to enable the mod
use sudo a2dismod php5.* to disable the mod
after running the two commands restart your apache2 server
using sudo systemctl restart apache2
The Apache loads the php5_module library in /etc/apache2/mods-available/php5.load.
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
If you know the loactions of your alternative libraries you can change them in this file.
After editing you need to restart your apache. sudo service apache2 restart or sudo systemctl restart apache2.service
Had the same issue on ubuntu16.
ls -l /etc/apache2/mods-available/php7* ,
showed 2 versions -
/etc/apache2/mods-available/php7.0.conf
/etc/apache2/mods-available/php7.2.conf
Deleted the /etc/apache2/mods-available/php7.0.conf, restarted apache2, and phpinfo() via apache2 showed php7.2

Amazon AWS Ubuntu php5 fpm php.ini file

I've installed an ubuntu machine on AWS, I installed php-fpm, and then I do phpinfo and get
Loaded Configuration File /etc/php5/fpm/php.ini
But when I make changes to the /etc/php5/fpm/php.ini file and restart php-fpm server, nothing happens, it is not loaded.
What could be the issue?
Is there a way to explicitly define what php.ini I want to use?

Fatal error: Class 'IntlDateFormatter' not found

I installed WAMP on my local machine. My PHP version is 5.3.3 in phpinfo() but that extension doesn't exist! :(
How can I install this extension without compiling it? Here is just source of it.
The extension was there! All you need to do is clearing the comment(;) before this line in php.ini file:
Windows:
;extension=php_intl.dll
to
extension=php_intl.dll
Linux:
;extension=intl
to
extension=intl
Then restart apache2 or php-fpm if you are using it.
if you see this on Debian / other Linux platforms.
sudo apt-get install php5-intl - for PHP 5.6
sudo apt-get install php7.0-intl - PHP 7+
Amazon Linux
sudo yum install php70-intl
After that restart Apache services.
sudo service apache2 restart restart apache to get the changes.
in wamp or xampp open php.ini file and find the below line, then remove comment (;) at first of it:
;extension=php_intl.dll
if you did not find the line, add it in the php.ini file:
extension=php_intl.dll
It may be because of Apache. Restart Apache by following command
service httpd restart
and try again.
If you added extension=php_intl.dll in your php.ini and it didn't work you can copy icu****.dll files (about five of them) from PHP folder to Apache /bin folder.

Categories