XAMPP for OS Xããããªãå¤ãã£ãXAMPP-VM for OS X ã®ã¡ã¢
â» ããã¯è«¸è¬ã®äºæ ã§èª¿ã¹ãã¡ã¢ã§ãã7.1.10 ã® Previewç ã«ã¤ãã¦æ¸ãã¦ããã®ã§ããã¼ã¸ã§ã³ã¢ããã«ã¨ããªã£ã¦æ¹åãããããããã¾ãããã¨ãããããã¦ããï¼ï¼ â»
Apache PHP MySQLï¼MariaDBï¼ã®ä¸æ¬ã¤ã³ã¹ãã¼ã©ã¼ã¨ãã¦ä¸»ã«åå¿è 層ã«äººæ°ã®XAMPPã§ãããæè¿ã®ãã¼ã¸ã§ã³ã«ããã¦ããªãä»æ§ããããã¾ããã
諸è¬ã®äºæ ã§çµæ§ãªãã¾ããæ°åã«ãªã£ã¦ããã®ã§ãããã¨ããããã©ããã風ã«ãªã£ãã®ãã¡ã¢ã§ãã
å¹³ããè¨ã£ã¦ãVMï¼Linuxï¼ã«ãªã£ã
ãã¾ã¾ã§ã®XAMPPã¯OSXç¨ã®PHPãApacheçãã¯ãã£ã¦ãããOSXã®ãã¤ãã£ãããã°ã©ã ã¨ãã¦åä½ãã¦ãã¾ããã
å人çã«ã¯ãã®ä½ãã¯å¥½ã¾ããã¨ããã£ã¦ãã¦ãOSXã§ãã©ãã©ã«ApacheãPHPãMysqlãå ¥ãã¦ã¤ãªãåãããæéãèããã¨XAMPPã¯æ¥½ã§ãã
ä»®ã«èªåã使ããªãã¨ãã¦ã人ã«æããã®ã«ã¯æ¥½ã ããã¢ã³ã¤ã³ã¹ãã¼ã«ãæ¶ãã ãã ããCLIããããªãã®ã¯åå¿è ã«ããã
ããããããXAMPP-VMã«ãªããä»®æ³ãã·ã³ã®ä¸ã§ãããLinuxï¼Debianï¼LinuxçXAMPPï¼ã¨VMãã¡ãã£ã¨æä½ããXAMPPã³ã³ããã¨ããå½¢ã«å¤åãã¾ãããå®å ¨ã«å¥ç©ã§ãã
ãã§ã«å ¬å¼ãµã¤ãã§ã¯VMçãæåé¢ã«ã§ã¦ãã¾ãã
ï¼éå»ã®ãã¼ã¸ã§ã³ããã¦ã³ãã¼ããã¼ã¸ã«ããã°ã¾ã DLã§ãã¾ãããã¢ãããã¼ããããã¦ããããã§ããï¼
ãã®å¤§å¤åã«ã¤ãã¦ã®èª¬æ
ãã®å¤æ´ã«ã¤ãã¦å ¬å¼Blogã§ã®è¨åã¯è²ã 説æã¯ããã¾ãããBlogã¿ããªã¿ã¦ãªãã§ããâ¦ã
https://www.apachefriends.org/blog/new_xampp_20170628.html
Developing a PHP application on XAMPP-VM for OS X
ãtell us what you thinkãã¨ããã¦ãããã®ã®ãæ°ã¶æã§ãããã£ã¡ãã¡ã¤ã³ã«ãªãããããã¨ããæ°åãããã¾ããã
ä¸çªã®åé¡ã¯ãåå¿è ã«ãã³ããããªå¤åãå¤ãäº
XAMPPã¯åå¿è åãã¨ãã£ã¦ééããªãã¨æãã¾ããåå¿è ããã£ããã£ã¦ããããªããPHPã¨æ¯ãããããããã«ããã¨ãããã¾ãã
ãããã¯ãµã¼ãã¼ã«èå³ã®ãªãã¦ã§ã製ä½ã®äººãã·ã¥ãã¨ã¤ããããã«ããã¨ãããã¾ãã
ãããã£ã人ãã¡ã¯ç°¡åã ããXAMPPãé¸ãã§ããã®ã§ãç°¡åã§ãªããªã£ãXAMPPã«ä¾¡å¤ã¯ããã¾ããã
å¤ãã®æ¸ç±ãã¦ã§ããµã¤ãã§ã¹ã¯ã·ã§ã¤ãã§ç´¹ä»ããã¦ãããã使ã£ã¦ããããã以ä¸ã§ããã以ä¸ã§ããªãâ¦
ãããç»é¢ãããã£ã¡ã¾ã£ããã â¦ã
ãã¼ã«ã«ã®FSã§ã¯ãªã
VMãªã®ã§htdocsã¯VMã®ä¸ã«ããç´æ¥ã¢ã¯ã»ã¹ã§ãã¾ããã
ã¢ã¯ã»ã¹ããææ³ã¯ããã¤ãããã¾ããâ¦
- XAMPPã³ã³ããããnfsãã¦ã³ã => ããã©ã«ãã§ã¯ç¡å¹
- ã·ã§ã«ã§ã¯ãã£ã¦æä½ => åå¿è ã«ã¯ç¡ç
- scp, sftp => åå¿è ã«ã¯ï¼ry
- FTP => ç¥
ã³ã³ããã«ã¯VMã®ã¹ãã¬ã¼ã¸ãNFSãã¦ã³ããããã¿ã³ããããæ¼ãã¨VMã®/opt/lamppããã¦ã³ãããã¦Finderã§æä½ã§ããããã«ãªãã¾ãï¼å¾è¿°ãã¾ãã権éãå¾®å¦ï¼ã
ãã ãããã¿ã³æ¼ãã ããã§ãé£ããã®ãåå¿è ã§ãããä¸æéå¢ãã¦ããæãã§ãã
localhostã§ãªããªã£ã
htdocsã«ãã¡ã¤ã«ããããããåºå®çãªURLãã® http://localhost ãéãã®ããã¾ã¾ã§ã§ããã
ãããVMã¯localhostã§ã¯ãªãã®ã§ã192.168.64.5ï¼çï¼ï¼ãéãå¿ è¦ãããã¾ãã
ããã¯XAMPPã®ã³ã³ããã«è¡¨ç¤ºããã¦ãã¾ãã®ã§ãããè¦ã¦å ¥åããã°ãããã§ããã©ããã¯ãåå¿è ã«ã¯ãã¼ã¡ãªããã§ãã
ãªããXAMPPã®ã³ã³ããã«ã¯ssh ãã¼ããã©ã¯ã¼ãã£ã³ã°ãGUIã§è¨å®ããæ©è½ãããããªã³ã«ããã°localhost:8080ãvm:80ã«ã¤ãªããã¾ãã
ï¼ãã®æéã¯ç¡é§ã§ã¯ï¼ã¨æãã¾ããâ¦ï¼
phpMyAdminãã¨ã©ã¼ã«ãªã
ã³ã³ãããããGo to Applicationãã¨ãããã¿ã³ãæ¼ãã¨ãããªãã¿ã®XAMPPã®ããã©ã«ããã¼ã¸ã表示ããã¾ãã
ããã©ã«ããã¼ã¸ã«ã¯XAMPPã®ãã«ãã¨phpMyAdminã¸ã®ãªã³ã¯ãããã®ã§ãããªãã¨ãã®phpMyAdminã«ã¢ã¯ã»ã¹ã§ãã¾ãããApacheå´ã®å¶éã§localhost以å¤ããã®æ¥ç¶ãå¼¾ãã¦ããããã§ãã
ã¢ã¯ã»ã¹è¨±å¯æ¹æ³ã¯ããã©ã«ããã¼ã¸ãããªã³ã¯ãããHow toãã¼ã¸ã«è¨è¼ãã¡ããã¨ããã¾ãããããã
ããããsshã§ãã®ãã¡ã¤ã«ã®ãã®è¡ãä¿®æ£ãããã¨ããæãã§ãXAMPPã使ã層ã«ã¯ãã³ãããã
sshèªä½ã¯ã³ã³ããã®ãOpen Terminalããã¿ã³ãããã°ã¯ã³ã¿ããã§ã¤ãªããã¾ããâ¦ã
ä¸å¿ãåè¿°ã®ãã¼ããã©ã¯ã¼ããã¤ããã° http://localhost:8080/phpmyadmin ã§æ¥ç¶ã§ããããã«ã¯ãªãã¾ãã
ã¨ãããå¥ã®ã¨ããã«ã¯ãã£ã¡ã§èª¬æããã¦ããã¾ããããªãã§ãã
ãªããã¼ããã©ã¯ã¼ãã¯ããã©ã«ãã§ãrequire localãã¨ãããªãã·ã§ã³ãOnã«ãªã£ã¦ãããããã¯ãããã -g ã®äºã ã¨æãã¾ãã
ããã§ãªããã°ãã¿ã³ä¸çºæé»ã§ãphpmyadmiãå¤ã«éæ¾ããã¦ã¤ãããæãã¾ããï¼åèã¾ã§ã«ãXAMPPã®mysqlã¯ããã©ã«ãã§root ãã¹ã¯ã¼ãã¯ç©ºã§ãï¼
ãªã¾ããã¿ã³ãããã°ãã¼ããã©ã¯ã¼ãè¨å®ãã§ããã®ã¯ãåæãªãããããããã£ããã§ãã¾ããï¼ãæ°æã®äººãå¾®å¦ãªã¨ã³ããªããããªããå°ã ä¸å®ã«ãªãã¾ãã
UIDã¾ãã
NFSã§ãã¦ã³ãã§ããããä»ã¾ã§ã¨ããããªããï¼ã¨ãã«ããªã©ã«ã¯ããã®ã§ãããå®éã«ã¯æ¨©éå¨ãã§åé¡ãããã¾ãã
htdocsãªã©ã®ãã¡ã¤ã«ã®æ¨©éã¯bitnamiãApacheã¯daemon権éãã·ã§ã«ã¯root権éã§ãããã¦ãã¾ãããã®æç¹ã§å«ãªäºæãããã¾ããã
å®é htdocs/test.phpã« file_put_contents("a.txt", "hello");
ã¨ãã³ã¼ãæ¸ãã¦Apacheããphpãããããã¨Permissionããªãã¨ã¨ã©ã¼ãã§ã¾ããæ¸ãè¾¼ããªãã
NFSçµç±ã®Finderã§ã¯ãã¼ããã·ã§ã³ã®å¤æ´ãã§ããããµãã¼â¦ããã¯ã²ã©ãã
ãããã«sftpãã·ã§ã«ãFTPãªãã°ãã¼ããã·ã§ã³å¤ããããããã®ç¥èãéè¦ã ãã©ãããXAMPPã¤ãã層ãèããäºãªã®ã ãããã
ããã¯ã¢ãã
å½ç¶ãªãã§ããVMã®ä¸ã¯æé«æ©è½ã®Time machineã§å·®åããã¯ã¢ããã§ãã¾ããã
VMã¾ããã¨åããã¨ã¯æãã¾ãããæ¬å½ã«å¾©æ´»ããã®ãã¯è¬ã
ãªããVMã®ä¸ããã³ã³ãã³ããããã¯ã¢ããããæ©è½ããéçºä¸ãã ããã§ãï¼çç ®ãã â¦ï¼
FTP
XAMPPã§ã¯ä¼çµ±çã«FTPdãã¤ãã¦ããã®ã§ãããVMã¯å¤ããã¤ãªããªãã®ã§ãã¹ãPCããã®æ¥ç¶ã«ãã使ãã¾ãããFTPãããã³ã«ã¯ãã¼ããã©ã¯ã¼ãã§ããªããããªâ¦ï¼FTPdãæ®ãæå³ã¯ãã£ãã®ã ãããï¼ã
(ssh -D? ããåãã人ã¯FTPã¤ãããªãã§ããâ¦)
â¦ã¨ããæãã§
åå¿è ã«ããããã¯ãã®XAMPPããä¸æ°ã«åå¿è 殺ãã«ãªã£ãã¨ããææ³ã§ããã
å¤å°ã¯ããã人éãè¦ã¦ãçç ®ãæãããããåãæ¿ãã¯ææå°æ©ã ã¨æãã¾ãã
ããããããããã¼ã¸ããã®ãªã³ã¯ã¯ãã¯ãVMã«ããã¦ãã¾ã£ã¦ããå³ããã
ãããããããã«ããããPHPãã¨ããã¤ã¡ã¼ã¸ãä¸æã«èè² ã£ã¦ããXAMPPããã®ãããªãããããã§ã¢ãã³ã§ãããã¦ãªæ¹åãã«èµãåã£ãã®ã¯å¤§å¤æ®å¿µã§ãªãã¾ãããããããã®ã¯å¥ã®ãã¤ã«ãããã¨ãã°ããããâ¦ã
ã¨ãããã¨ã§ãç¾ç¶ã諸è¬ã®äºæ ã«ä¼´ã£ã¦ããã¹ã¼â¦ããåå¼ãã¦ãããâ¦Nativeçããã¤ã¾ã§æä¾ãããã®ãæãã¦ããâ¦ãã¨ãªããã§ããã¾ãã
ãªããWindowsã¯VMåããã¦ããã¾ããï¼ã®ã§ã諸è¬ã®äºæ ã§ã¯Windowsã使ãç¾½ç®ã«ãªã£ã¦ãã¾ãï¼ãWindowsæé«ï¼ï¼ï¼
以ä¸ãåå¿è ã«ã¯é¢ä¿ã®ãªã話
VMãªã®ã§ããã¹ããã ãã
諸è¬ã®äºæ ã§ããããªç»é¢ã§ã¹ã¯ã·ã§ãåãå¿ è¦ãããã¨ããXAMPPã¯æ®éã«ä»®æ³ãã·ã³ã®ä¸ã§ãããã¦ããã¾ããã XAMPP VMã¯Nested VMããµãã¼ãããã¦ããªãã¨ã¨ã©ã¼ã«ãªãã¾ããï¼VMããHyper Vãè¦ãã¦ãªãã¨ãã¡ï¼
Parallels ãæç¨ãã¦ããã§ããProçãããªãã¨ãããã¤ãããªããã§ãããâ¦ã¤ããâ¦ã
VMã«ã¤ãã¦
OSã¯Debian 8.7ã§ããæ®éã«apt-getã§ããã®ã§å°ããã¨ã¯ãªãã§ããã
VMå ã®ã¡ã¢ãªã¯1GBã§ããå¤æ´ããæ¹æ³ã¯ã¿ã¤ãã¦ã¾ããã1GBã¨ãéã§å¼·ããªãããåãã¨è¶³ããªããªããã§å¤æ´ãããâ¦ãã£ã¦ãããPHPæ¸ãããã ããªã®ã«VMã®ã¡ã¢ãªç®¡çããããªãã§ããâ¦ã
Diskã¯15GBã§ããããã¯å°å³ã«è¶³ããªããªããããå¢ããæ¹æ³ã¯ãã¯ãã¿ã¤ãã¦ãã¾ããã
VMã«sshããéµã¯XAMPP.appã®ä¸ã«ã¯ãã£ã¦ã¾ãã¦ãããã¤ãã¤ããã°æ®éã«SSHã§ãã¾ãããã ããã®éµã¯å ±éã§ã¯ãªããï¼snakeoilãªã®ã§ã¯ãªããâ¦ï¼ä¸å®ã§ãã
NFSã§ãã¦ã³ãããã®ã§ãããããfsç£è¦ç³»ã®ãã¼ã«ã¯åããªããªãã¨æãã¾ããä¸é¨ã®ãã¼ã«ãã¨ãã£ã¿ãIDEã§ã¯æ´æ°æ¤ç¥ãå¹ããªãã¦ãã³ããããVMã¯Linuxãªã®ã§VMããOSXã®é åããã¦ã³ããããã¨ã¯ã§ããã§ããããããã¾ã§ã§ãã人ãXAMPPã¤ããã¨ã¯ãããã¾ããã
ããããXAMPPã¯ä¼æ¥ã®Bitnamiãããã¯ã«ä»ããã¤ã³ã¹ãã¼ã©ã¼ã§ã¡ãã£ã¨ããåºåãã§ããã¨ãé¤ãã°å®å®ãã¦ãªãªã¼ã¹ããã¦ããã®ã§å¿æ´ãã¦ããã¾ããã*1ãããã«ãã¦èª°ãã¤ãã£ã¦ãªãï¼è¨ãéãï¼Linuxçã«å¯ãããã¨ããåãã¯ãã¾ãã¡ããæããããã¾ãããï¼Bitnami Modulesã¾ã§ã¡ã³ããããã¨ãèããã¨ããã©ãããã©ã¼ã ãã¸ããããã®ãããããªãâ¦éªæ¨ã§ããï¼
*1:bitnamiã®ãµã¤ããéããã§ãã¯ãå¤ããï¼ã¨ãæ¸ããªãçãªäºã§