우분투에서 apt-get으로 설치한 PHP를 기준으로 설정합니다. php.ini 위치 : /etc/php5/apache2/php.ini 기본값으로 제공되는 php.ini 파일은 실서비스를 위한 환경설정(php.ini-production) 내용을 담고 있으며, 개발을 위한 환경설정(php.ini-development)도 샘플파일로 제공을 한다. 샘플파일 위치 : /usr/share/php5/ .htaccess를 이용한 php.ini 수정호스팅을 받는 경우나 특정한 사이트에만 설정내용을 반영하고 싶을 경우는 해당 사이트의 루트에 .htaccess 파일을 생성하여 설정할 수 있다.
업로드 설정
Apache 재시작
upload_max_filesize와 post_max_size폼을 이용해 전송되는 업로드 파일은 'multipart/form-data'라는 포맷으로 전송된다. 이때 전송량에 상한선을 설정할 수 있는데 이 값은 post_max_size > upload_max_filesize
기본값 post_max_size = 8M / upload_max_filesize = 2M memory_limitphp엔진이 POST로 전달되는 데이터를 처리하는 경우에는 전달되는 데이터의 일부를 유지하기 위해 메모리가 사용된다. php를 설치시에 기본값 memory_limit = 128M max_execution_time과 max_input_timemax_execution_time은 스크립트의 최대 실행 시간이고 이 값이 0이면 무제한, max_input_time은 스크립트가 입력을 받아들일때 소비할 수 있는 시간이며 -1이면 무제한, 잘못된 스크립트 사용시 서버가 무한루프에 빠지는것을 방지하기 위한 부분이다. 만일 여러 메가 바이트의 데이터를 전송해야 하는 경우 max_input_time은 높아야 한다. 또한, 스크립트에서 set_time_limit() 함수를 호출해서 max_input_time의 ini파일의 설정을 재정의 할 수 있다. php에서 set_time_limit(0)으로 설정하면 두가지 시간을 모두 제어할수 있어 업로드페이지에 이 코드를 삽입하는 것을 추천한다. 기본값 max_execution_time = 30 / max_input_time = 60 Apache 설정아파치 웹서버에서는 LimitRequestBody라는 지시어를 사용해 POST 데이터에 제한을 할 수 있는데 이 값이 설정되어 있다면 다른것 보다 우선시 되니 유의해야 한다. 몇몇의 배포판 설치시에 이 값이 512kb로 설정되어 있기도 하다. 여러개의 웹사이트를 사용할 경우 기본값을 설정해 두고 대용량의 업로드 설정이 필요한 경우 아래와 같이 .htaccess 를 이용해 필요한 사이트에만 적용하도록 하자. 최대 파일 업로드 사이즈를 2000 메가바이트로
최대 POST 데이터 사이즈를 2000 메가바이트로POST 데이터 = 업로드 파일 데이터 + 헤더 등 요청데이터 이므로 upload_max_filesize보다 크게 잡는게 산술적으로 옳다.
실행시간 무한대php 스크립트에 set_time_limit(0) 설정 추천, 그게 불가능할경우 아래 설정사용
최대 메모리 무한대
업로드 설정시 유의사항업로드 디렉토리 안의 php 파일 실행 불가
에러 출력기본적으로 실서비스를 위해 에러출력이 Off 되어 있다. 개발환경을 위해서는 이를 On 시키도록 하자.
시간대 설정
date.timezone이 주석처리 되어 있을 경우에, 오류 발생시 항상 다음과 같은 에러가 따라온다.
위와 같은 date.timezone = Asia/Seoul 로 설정해주면 해결됨. I need to reload my php.ini and there's nothing in the help dialog about restarting it.
asked Oct 12, 2010 at 1:58
Note: prepend
Or whatever the equivalent is on your system.
answered Oct 12, 2010 at 3:37
tylerltylerl 14.9k7 gold badges49 silver badges71 bronze badges 5 For Mac OS X, this is what I do: Make a script
Then:
make sure /usr/local/sbin is in your $PATH then just call it from the terminal fpm-restart and BOOM!!
Falcon Momot 25k13 gold badges61 silver badges92 bronze badges answered Sep 23, 2013 at 4:55
3 Usually, But somtimes, it fails, telling you Now, if you do not like to reboot your server, just kill the processes and have a fresh start (edited as of here):
answered Aug 8, 2014 at 11:55
BurninLeoBurninLeo 8602 gold badges11 silver badges28 bronze badges 1 This should work:
answered Feb 1, 2011 at 20:08
dialt0nedialt0ne 3,02718 silver badges27 bronze badges 5 For Mac OSX answered Dec 30, 2015 at 21:25
1 I had a problem restarting php7-fpm, because I didn't knew how exactly the service was named. This function gave me the answer:
php7-fpm service in my Ubuntu was called
answered Mar 26, 2017 at 8:57
GediminasGediminas 2172 silver badges8 bronze badges 1 php-fpm will restart if you send a USR2 signal to the main process:
So we just need to instruct php-fpm to record its pid somewhere. In this example, I'll assume
you want to save it at
Then create the file
Now, next time php-fpm starts, you'll be able to get its pid and restart it like this:
Or you can combine these into a single command:
answered Mar 12, 2014 at 7:01
PitarouPitarou 1611 silver badge3 bronze badges 2 For me I had just upgraded via apt and the service restart wasn't working. I ended up needing to kill the existing processes before it worked using: killall php5-fpm answered Sep 25, 2013 at 19:24
PoochPooch 1612 bronze badges To allow the PHP-FPM restart script to work, you must use specify a PID file in your php-fpm.conf file. i.e.
The default value for pid in php-fpm.conf is nothing, which means to not create a PID file, which means that the restart script can't tell which process to end during the restart. answered May 11, 2013 at 15:03
DanackDanack 1,1861 gold badge14 silver badges27 bronze badges On CentOS 7
answered Jun 28, 2016 at 10:44
On Ubuntu 16 with php 5.6 fpm.
answered Oct 11, 2016 at 9:20
MrPHPMrPHP 1416 bronze badges On RedHat / CentOS 7 using PHP 7 from softwarecollections.org
or if you're using systemctl:
answered Jun 3, 2017 at 16:17
The simplest way to find the name of php-fpm service is to search for it:
answered Mar 17, 2019 at 16:33
1 On Windows:
answered Sep 9, 2015 at 6:46
Gerald SchneiderGerald Schneider 20.1k8 gold badges52 silver badges79 bronze badges For old versions of debian & ubuntu - php 5.6 it will be
answered Sep 9, 2015 at 6:01
On Alpine with nginx this is working here: To kill all php-fpm7 processes:
To start php-fpm7:
answered May 16, 2017 at 20:08
To list systemd services on CentOS/RHEL 7.x+ use
To list all services:
Where you can find service named * php-fpm * copy service name and run the following command
NOTE : ea-php72-php-fpm.service user your service name answered Nov 26, 2018 at 8:55
Another method for MaxOS Open ActivityMonitor, search php-fpm, find the pid. Open terminal, use Then If there is error information that 127.0.0.1:9000 Already in use, just ignore that. Refresh Nginx page, should see php.ini changes take effects. answered Sep 23, 2019 at 8:31
1 |