Programing

MAMP는 php.ini를 어디에 보관합니까?

lottogame 2020. 9. 17. 18:51
반응형

MAMP는 php.ini를 어디에 보관합니까?


나는 최근에 맥을 가지고 있으며 맥에서 개발하는 데 전혀 익숙하지 않습니다.

MAMP Pro 1.9.6.1이 있습니다. 나는 위치를 php.ini찾았고 이것을 얻었다.

$ locate php.ini
/Applications/MAMP/conf/php5.2/php.ini
/Applications/MAMP/conf/php5.3/php.ini
/Library/Application Support/appsolute/MAMP PRO/conf/php.ini
/private/etc/php.ini.default

나는 그들 모두의 이름을 바꿨다. MAMP를 다시 시작했습니다. 장애없이로드되었습니다 (이상한 것을 알고 있습니까?). PHP 버전 5.2를 사용하고 있습니다.

이 모든 파일은 이제 다른 이름입니다 (제거 프로세스를 위해 하나씩 수행됨). 그래서 나는 Mac을 다시 시작합니다. 동일하게 모든 php.ini파일이 이동 되었지만 MAMP는 문제를로드하지 않았습니다. 램프에 이것은로드되지 않을 것입니다. 그러나 php.ini내가 놓친 다른 파일 이 있거나 (어떻게할지 모르겠다 updatedb) MAMP는 정말 지능적이며 모든 파일을 가져 오거나 (가능성이 낮음) 하나를 사용하지 않습니다.


참고 : 이것이 도움이되지 않으면 아래에서 Ricardo Martins의 답변을 확인하십시오.


그 안에 PHP 스크립트를 <?php phpinfo() ?>만들고 브라우저에서 실행 한 다음 값을 찾으십시오 Loaded Configuration File. 이것은 php.ini웹 서버의 컨텍스트에서 PHP가 사용 하는 파일을 알려줍니다 .


MAMP (비 PRO)가 동일한 지 확실하지 않지만 MAMP는 php.ini시작할 때마다 수정 된 내용을 재정의 합니다.

제 경우에는 MAMP 메뉴를 사용하여 php.ini file( File -> Edit Template -> PHP -> PHP 5.xx -> php.ini) 를 변경해야했습니다 .


더 명확하게하기 위해 (이 스레드를 읽었지만 여기에있는 경우에도 솔루션을 보지 못했습니다!) 동일한 문제가 발생하여 원인을 찾았습니다. 잘못된 php.ini를 수정했습니다!

예, MAMP에는 2 개의 php.ini 파일이 있습니다.

  1. Applications / MAMP / conf / php5.5.10 / php.ini
  2. 응용 프로그램 /MAMP/bin/php/php5.5.10/conf/php.ini

오른쪽 php.ini 파일은 두 번째 파일입니다. Applications / MAMP / bin / php / php5.5.10 / conf / php.ini

이를 증명하려면 .php 파일을 만들고 (원하는대로 이름을 지정합니다 (예 : "info.php")) 간단한 phpinfo ()

<?php
echo phpinfo();

브라우저에서 열고 "Loaded Configuration File"을 검색합니다. 내 이름은 "/Applications/MAMP/bin/php/php5.5.10/conf/php.ini"입니다.

여기에 오류가있었습니다. 나는 Applications / MAMP / conf / php5.5.10 / php.ini를 편집했지만 이것은 수정하기에 잘못된 파일입니다! 사실 올바른 php.ini 파일은 bin 디렉토리에있는 파일입니다.

문자 그대로 1 시간 30 분의 두통을 일으킨이 작은 차이를 처리하세요!


편집해야하는 파일은 MAMP Pro에 있으며 php.ini시작할 때마다 파일을 사용합니다 .

  • MAMP PRO 시작
  • 편집하다 File > Edit Templates > PHP 5.3.2 php.ini
  • MAMP Pro 다시 시작

변경 사항이 유지되어야합니다.


터미널에서 다음 명령을 실행하면 로드 된 구성 파일이 내가 찾은 가장 쉬운 방법을 보여줍니다 .

php --ini

5.2 버전의 php를 사용하는 경우 /Applications/MAMP/conf/php5.2/php.ini를 변경하십시오. 5.3 php 버전을 사용하는 경우 /Applications/MAMP/conf/php5.3/php.ini를 편집하십시오.

OSX Lion 또는 OSX Mountain Lion을 사용하는 경우 apache 및 php의 기본 설치를 사용하는 것이 좋습니다.

인사!


나는 당신이 이것에 대한 답을 찾았는지 모르겠지만 이것을하기 위해 MAMP PRO가 필요하지 않았습니다. 다른 사람들의 말을 따라 올바른 길로 가십시오. 마치 ...

MAMP-> bin-> php-> php (내 php 버전)-> conf-> php.ini

The key here is where you're editing the file. I was making the mistake of editing the commented part of the ini file. You actually have to scroll down to LINE #472 where it says "display_errors = Off and change it to On. Hope this helps any


Probably the fastest way to access the PHP.ini for the currently loaded version of PHP in MAMP PRO (v.4.2.1):

  1. Open MAMP Pro
  2. Click on "PHP" under the "Languages" section on the sidebar
  3. Tap on the arrow button right next to the drop-down that lets you select the "Default Version" of PHP.

It depends on which version of PHP your MAMP is using. You can find it out on: /Applications/MAMP/conf/apache/httpd.conf looking for the configured php5_module.

After that, as someone said before, you have to go to the bin folder. There you'll find a conf folder with a php.ini inside.

example: /Applications/MAMP/bin/php/php5.4.10/conf

Leo


After running the MAMP server, you have php info link in toolbar Once click, You will get all information about php enter image description here


After going through all the solutions here, the easiest way to find the loaded php.ini file is to go into phpinfo on the loaded MAMP webpage, which will show you the loaded php.ini file.

This will also confirm if the parameters you change, like max_file_size, have updated correctly.


I only have the non-pro version of MAMP but just because it loads it doesn't mean the PHP file is being found/without errors.

I renamed my php.ini files and MAMP still started but Apache returned several errors.

What are you trying to change in your php.ini file?


I have checked all answers and of course I have used phpinfo() to check the exact location of php.ini. I don't see a File option in the menu bar on my mac. I changed both php.ini and php.ini.temp files in that folder. No vail.

Until I realized that I forgot to uncomment the modified always_populate_raw_post_data line.


On my mac, running MAMP I have a few locations that would be the likely php.ini, so I edited the memory_limit to different values in the 2 suspected files, to test which one effected the actual MAMP PHP INFO page details. By doing that I was able to determine that this was the correct php.ini: /Applications/MAMP/bin/php/php7.2.10/conf/php.ini

참고URL : https://stackoverflow.com/questions/11691767/where-does-mamp-keep-its-php-ini

반응형