Âç²È¥á¥â/MAMP/MAMP´Ä¶­¤Ç¤ÎPHP¥¨¥é¡¼É½¼¨ http://www.ark-web.jp/sandbox/design/wiki/300.html

Âç²È¥á¥â/MAMP/MAMP´Ä¶­¤Ç¤ÎPHP¥¨¥é¡¼É½¼¨

Âç²È¥á¥â/MAMP/MAMP´Ä¶­¤Ç¤ÎPHP¥¨¥é¡¼É½¼¨
[edit]

MAMP´Ä¶­¤Ç¤ÎPHP¥¨¥é¡¼É½¼¨

[edit]

Ìܼ¡

[edit]

phpinfo´Ø¿ô¤ÇMAMP´Ä¶­¤Ç¤ÎÀßÄê³Îǧ

MAMP¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤êÀßÄê¤Ëº¹°Û¤¬¤¢¤ë¤¿¤á¡¢¤Þ¤º¤Ï¸½¾õ¤ÎÀßÄê¤ò³Îǧ¤¹¤ë¤¿¤áphpinfo´Ø¿ô¤òµ­½Ò¤·¤¿php¥Õ¥¡¥¤¥ë¤òÍÑ°Õ¤·¤Þ¤¹¡£

<?php
phpinfo();
?>

¾åµ­¤ÎÆâÍƤòµ­½Ò¤·¤¿php¥Õ¥¡¥¤¥ë¤ò²¾¤Ëphp_test.php¤È¤·¡¢MAMP¤Î´Ä¶­²¼¤ØÇÛÃÖ¤·É½¼¨¤µ¤»¤Æ¤ß¤Þ¤¹¡£

Îã¤È¤·¤Æ¡¢

¤ÇÀßÄꤷ¤¿¡Öproject001¡×¥Ç¥£¥ì¥¯¥È¥êľ²¼¤ØÇÛÃÖ¤·¡¢¥Ö¥é¥¦¥¶¤Ë¤Æ

http://localhost:8001/php_test.php

¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤È¡¢°Ê²¼¤Î¤è¤¦¤Ê¾ðÊ󤬳Îǧ¤Ç¤­¤Þ¤¹¡£

img_phpinfo.gif

º£²ó¤Ï¤½¤ÎÃæ¤Î¡Öerror_log¡×¡Ödisplay_errors¡×¤Î¹àÌܤò³Îǧ¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£

[edit]

php.ini¤Îerror_log¡¢display_errors¹àÌܤÎÀßÄê³Îǧ

MAMP ¥Ð¡¼¥¸¥ç¥ó1.7.1¤Ç¡Öerror_log¡×¤Î¹àÌܤò³Îǧ¤·¤Æ¤ß¤ë¤È¡¢

img_error_log.gif

¤Èɽ¼¨¤µ¤ì¤Æ¤¤¤ë¤Î¤ÇÍ­¸ú¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢¥¨¥é¡¼¤Î¥í¥°¤Ïί¤Þ¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£

¼¡¤Ë¡Ödisplay_errors¡×¤Î¹àÌܤò³Îǧ¤·¤Æ¤ß¤ë¤È¡¢

img_display_error_off.gif

¤Î¤è¤¦¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢¡Ödisplay_errors¡×¤Ï̵¸ú¤È¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£
»î¤·¤ËÀè¤Û¤ÉÀßÄê³ÎǧÍѤ˺îÀ®¤·¤¿¡Öphp_test.php¡×¤ÎÆâÍƤò¤ï¤¶¤È´Ö°ã¤¨¤¿ÆâÍƤˤ·¡¢¡Öphp_test2.php¡×¤È¤·¤Þ¤¹¡£

<? php  // ¤ï¤¶¤È¥¹¥Ú¡¼¥¹¤òÆþ¤ì¤Æ¤ß¤Þ¤·¤¿
phpinfo();
?>

¤³¤Î¥Õ¥¡¥¤¥ë¤ò³Îǧ¤¹¤ë¤¿¤á¡¢¥Ö¥é¥¦¥¶¤Ç

http://localhost:8001/php_test2.php

¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤ß¤Þ¤¹¡£

¤¹¤ë¤È¡Ödisplay_errors¡×¤¬Ìµ¸ú¤È¤Ê¤Ã¤Æ¤¤¤ë¤¿¤á¡¢¥¨¥é¡¼¤¬¤¢¤Ã¤Æ¤â¥Ö¥é¥¦¥¶²èÌ̤ˤϲ¿¤âɽ¼¨¤µ¤ì¤º¡¢½¤Àµ»þ¤Î¼ê½õ¤±¤È¤Ê¤ë¥¨¥é¡¼¤¬É½¼¨¤µ¤ì¤Þ¤»¤ó¡£

MAMP¤Î¥Ç¥Õ¥©¥ë¥È¤Ç̵¸ú¤È¤Ê¤Ã¤Æ¤¤¤ëÍýͳ¤È¤·¤Æ¤Ï¡¢¡Ödisplay_errors¡×¤ÎÀßÄê¤òµ­½Ò¤·¤Æ¤¢¤ëphp.ini¥Õ¥¡¥¤¥ë¤Ë¤âµ­½Ò¤·¤Æ¤¢¤ë¤è¤¦¤Ç¤¹¤¬¡¢

; Print out errors (as a part of the output). For production web sites,

; you're strongly encouraged to turn this feature off, and use error logging

; instead (see below). Keeping display_errors enabled on a production web site

; may reveal security information to end users, such as file paths on your Web

; server, your database schema or other information.

¤Ä¤Þ¤ê

http://jp2.php.net/manual/ja/errorfunc.configuration.php#ini.display-errors

³«È¯¤ò¥µ¥Ý¡¼¥È¤¹¤ë»ÅÁȤߤǤ¢¤ê¡¢ËÜÈ֤Υ·¥¹¥Æ¥à¤Ç¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó

¤È¤¤¤¦¤³¤È¤Î¤è¤¦¤Ç¤¹¡£

¤·¤«¤·¡¢¤³¤ÎÏ¢ºÜ¤Ç¤ÏMAMP¤Ï¤¢¤¯¤Þ¤Ç¥í¡¼¥«¥ë¤Î³«È¯´Ä¶­¤È¤·¤ÆÍøÍѤ¹¤ë¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤ë¤Î¤Ç¡¢¥¨¥é¡¼¤¬É½¼¨¤µ¤ì¤ë¤Û¤¦¤¬º£¸å²¿¤«¤ÈÊØÍø¤Ç¤¹¡£

¤½¤³¤Ç°Ê²¼¤ÎÊýË¡¤ÇPHP¤Î¥¨¥é¡¼¤¬É½¼¨¤µ¤ì¤ë¤è¤¦ÀßÄê¤ò¤·¤Þ¤¹¡£

[edit]

php.ini¥Õ¥¡¥¤¥ë¤Ë¤Ædisplay_errors¤òÍ­¸ú²½

php.ini¥Õ¥¡¥¤¥ë¤Îµ­½Ò¤ò½ñ¤­´¹¤¨MAMP´Ä¶­Æâ¤ÇPHP¥¨¥é¡¼¤Îɽ¼¨¤òÍ­¸ú¤Ë¤¹¤ë¤¿¤á¡¢

/Applications/MAMP/conf/php5/php.ini

¤Î¥Õ¥¡¥¤¥ë¤Îµ­½Ò¤«¤é¡Ödisplay_errors¡×¤ÎÀßÄê¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë²Õ½ê¤ò½¤Àµ¤·¤Þ¤¹¡£

php.ini¤ÎPATH(¾ì½ê)¤Ï¾åµ­¤Îphpinfo¤Ë¤Æ³Îǧ¤Ç¤­¤Þ¤¹¡£

¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï

display_errors = Off

¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç

display_errors = On

¤È½ñ¤­´¹¤¨¤Þ¤¹¡£
Ç°¤Î¤¿¤á°ìÅÙMAMP¤òºÆµ¯Æ°¤·¤Æ¤«¤é¡¢Àè¤Û¤É¤ï¤¶¤Èµ­½Ò¤Î´Ö°ã¤¤¤ò¤·¤¿¥Õ¥¡¥¤¥ë

http://localhost:8001/php_test2.php

¤òɽ¼¨¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£

img_php_error.gif

º£Å٤ϥ¨¥é¡¼¤¬É½¼¨¤µ¤ì¡¢¸¶°ø¤È¤·¤Æ¹Í¤¨¤é¤ì¤ë²Õ½ê¤â»ØŦ¤·¤Æ¤¯¤ì¤Þ¤·¤¿¡£

Ç°¤Î¤¿¤á

http://localhost:8001/php_test.php

¤Ë¥¢¥¯¥»¥¹¤·¡¢¸½ºß¤ÎÀßÄê¤ò³Îǧ¤·¤Æ¤ß¤Þ¤·¤ç¤¦

img_display_error_on.gif

¡Ödisplay_errors¡×¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤¬³Îǧ¤Ç¤­¤Þ¤·¤¿¡£

¤³¤ì¤Çº£¸åMAMP´Ä¶­²¼¤Ç¤âPHP¤Î¥¨¥é¡¼¤¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¡¢¥¨¥é¡¼²Õ½ê¤òÆÃÄꤷ¤ä¤¹¤¯¤Ê¤ë¤«¤È»×¤¤¤Þ¤¹¡£

[edit]

´ØÏ¢µ­»ö

[edit]

»²¹Íµ­»ö

Åê¹Æ¼ÔÂç²È? | ¥Ñ¡¼¥Þ¥ê¥ó¥¯

| append.gif

źÉÕ¥Õ¥¡¥¤¥ë: fileimg_display_error_off.gif 1052·ï [¾ÜºÙ] fileimg_display_error_on.gif 2707·ï [¾ÜºÙ] fileimg_php_error.gif 2776·ï [¾ÜºÙ] fileimg_error_log.gif 2800·ï [¾ÜºÙ] fileimg_phpinfo.gif 1006·ï [¾ÜºÙ]

¥È¥Ã¥×   ÊÔ½¸ Åà·ë º¹Ê¬ ¥Ð¥Ã¥¯¥¢¥Ã¥× źÉÕ Ê£À½ ̾Á°Êѹ¹ ¥ê¥í¡¼¥É   ¿·µ¬ °ìÍ÷ ñ¸ì¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS
Last-modified: 2015-07-11 (ÅÚ) 12:13:24 (3417d)

¥¢¡¼¥¯¥¦¥§¥Ö¤Î¥µ¡¼¥Ó¥¹¤ä¥½¥ê¥å¡¼¥·¥ç¥ó¤Ï¤³¤Á¤é