{"id":1138,"date":"2013-09-02T23:30:04","date_gmt":"2013-09-02T14:30:04","guid":{"rendered":"http:\/\/appsweets.net\/blog\/?p=1138"},"modified":"2013-09-03T03:14:49","modified_gmt":"2013-09-02T18:14:49","slug":"php-in-cygwin","status":"publish","type":"post","link":"http:\/\/appsweets.net\/blog\/2013\/09\/02\/php-in-cygwin\/","title":{"rendered":"PHP in cygwin"},"content":{"rendered":"<div class=\"856f7bdf6ce2541193600c6e03dd1a56\" data-index=\"1\" style=\"float: left; margin: 16px 16px 16px 0;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-5825700137064158\";\r\n\/* 250sq, appsweets-blog *\/\r\ngoogle_ad_slot = \"4837931762\";\r\ngoogle_ad_width = 250;\r\ngoogle_ad_height = 250;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>\u666e\u6bb5 Windows \u4e0a\u3067\u4f5c\u696d\u3057\u3066\u3044\u308b\u3068\u3044\u3063\u3066\u3082\u3001\u5b9f\u969b\u306f cygwin \u306e\u7aef\u672b\u306e\u4e2d\u3067\u3061\u304f\u3061\u304f\u3057\u3066\u3044\u308b\u308f\u3051\u3060\u3002<\/p>\n<p>\u4e00\u65b9\u3067\u3001Windows \u5411\u3051\u306e PHP \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3082\u3057\u3066\u3044\u308b\u3002\u305d\u3046\u3059\u308b\u3068 cygwin \u306e\u4e2d\u304b\u3089 PHP \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u547c\u3073\u51fa\u3057\u305f\u304f\u306a\u308b\u6642\u3082\u3042\u308b\u3002\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3060\u308d\u3046\u304b\u3002<\/p>\n<p>\u7d14 Windows \u74b0\u5883\u5074\u306e path \u74b0\u5883\u5909\u6570\u3067\u3001\u3059\u3067\u306b php.exe \u306b\u306f\u30d1\u30b9\u3092\u901a\u3057\u3066\u3042\u308b\u3002\u307e\u305f cygwin \u306f\u8d77\u52d5\u6642\u306b\u305d\u306e path \u3092\u7d99\u627f\u3059\u308b\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a cygwin \u4e0a\u3067<\/p>\n<p><code lang=\"bash\">$ php -f C:\\path\\to\\script<\/code>\u3068\u3044\u3046\u306e\u306f\u3067\u304d\u308b\u3002\u6b21\u306b shebang \u3092\u901a\u3057\u3066\u5b9f\u884c\u3055\u305b\u305f\u3044\u3002\u3064\u307e\u308a <code lang=\"bash\">#!\/usr\/bin\/php<\/code> \u3068 1 \u884c\u76ee\u306b\u66f8\u3044\u305f php \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3055\u305b\u305f\u3044\u3002<\/p>\n<p>\u3046\u3061\u306e\u74b0\u5883\u3067\u306f\u3001cygwin \u4e0a\u306e php.exe \u306e\u4f4d\u7f6e\u306f [cci]\/cygdrive\/c\/Program Files (x86)\/php\/current\/php.exe[\/cci] \u3060\u3002\u305d\u3053\u3067\u307e\u305a\u3001\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3067 <code lang=\"dos\">> cd C:\\cygwin\\bin<br \/>\n> mklink php.exe \"C:\\Program Files (x86)\\php\\current\\php.exe\"<\/code> \u306a\u3069\u3068\u3057\u3066\u307f\u305f: \u5931\u6557\u3002Windows \u3067\u306f\u5b9f\u884c\u5f62\u5f0f\u3092\u6307\u3059\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092\u5b9f\u884c\u3057\u305f\u3068\u304d\u3001argv[0] \u304c\u771f\u306e\u5b9f\u884c\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u5dee\u3055\u306a\u3044\u3088\u3046\u3060\u3002\u305d\u308c\u306f\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u3057\u305f\u307e\u307e\u3060\u3002\u3060\u304b\u3089\u3001\u5b9f\u884c\u5f62\u5f0f\u3092\u6307\u3059\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092\u5b9f\u884c\u3057\u305f\u5834\u5408\u3001\u5b9f\u884c\u5f62\u5f0f\u306e\u5b58\u5728\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u8d77\u70b9\u306b\u3057\u3066\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3060\u308a\u3059\u308b\u51e6\u7406\u306f\u3053\u3068\u3054\u3068\u304f\u5931\u6557\u3059\u308b\u3002\u3046\u3061\u306e\u74b0\u5883\u306e php \u306e\u5834\u5408\u3001php.exe \u306e\u96a3\u306b\u304a\u3044\u3066\u3042\u308b php.ini \u304c\u8aad\u307f\u8fbc\u307e\u308c\u306a\u3044\u3002<\/p>\n<p>\u305d\u3046\u3044\u3046\u308f\u3051\u3067 \/usr\/bin\/php \u3068\u3057\u3066<br \/>\n<code lang=\"bash\"><br \/>\n#!\/bin\/sh<br \/>\nexec \"\/cygdrive\/c\/Program Files (x86)\/php\/current\/php.exe\" \"$@\"<br \/>\n<\/code><br \/>\n\u3066\u306a\u611f\u3058\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7f6e\u304f\u3068\u52d5\u304f\u3002<\/p>\n<p>\u307e\u305f\u3001php \u30b9\u30af\u30ea\u30d7\u30c8\u5074\u3092<br \/>\n<code lang=\"php\"><br \/>\n#!\/usr\/bin\/env php<br \/>\n<?php echo \"hello, world\\n\"; ?><br \/>\n<\/code><br \/>\n\u3068\u3057\u3066\u3082\u3044\u3044\u3002\u3042\u3093\u307e\u308a\u3053\u306e env \u306e\u30c8\u30ea\u30c3\u30af\u597d\u304d\u3058\u3083\u306a\u3044\u3051\u3069\u3001\u5b9f\u8cea\u7684\u306b\u306f\u3044\u3061\u3070\u3093\u697d\u304b\u306a\u30fc\u3002<\/p>\n<div class=\"856f7bdf6ce2541193600c6e03dd1a56\" data-index=\"1\" style=\"float: left; margin: 16px 16px 16px 0;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-5825700137064158\";\r\n\/* 250sq, appsweets-blog *\/\r\ngoogle_ad_slot = \"4837931762\";\r\ngoogle_ad_width = 250;\r\ngoogle_ad_height = 250;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>\u666e\u6bb5 Windows \u4e0a\u3067\u4f5c\u696d\u3057\u3066\u3044\u308b\u3068\u3044\u3063\u3066\u3082\u3001\u5b9f\u969b\u306f cygwin \u306e\u7aef\u672b\u306e\u4e2d\u3067\u3061\u304f\u3061\u304f\u3057\u3066\u3044\u308b\u308f\u3051\u3060\u3002 \u4e00\u65b9\u3067\u3001Windows \u5411\u3051\u306e PHP \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3082\u3057\u3066\u3044\u308b\u3002\u305d\u3046\u3059\u308b\u3068 cygwin \u306e\u4e2d\u304b\u3089 PHP \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u547c\u3073\u51fa\u3057\u305f\u304f\u306a\u308b\u6642\u3082\u3042\u308b\u3002\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3060\u308d\u3046\u304b\u3002 \u7d14 Windows \u74b0\u5883\u5074\u306e path \u74b0\u5883\u5909\u6570\u3067\u3001\u3059\u3067\u306b php.exe \u306b\u306f\u30d1\u30b9\u3092\u901a\u3057\u3066\u3042\u308b\u3002\u307e\u305f cygwin \u306f\u8d77\u52d5\u6642\u306b\u305d\u306e path \u3092\u7d99\u627f\u3059\u308b\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a cygwin \u4e0a\u3067 $ php -f C:\\path\\to\\script\u3068\u3044\u3046\u306e\u306f\u3067\u304d\u308b\u3002\u6b21\u306b shebang \u3092\u901a\u3057\u3066\u5b9f\u884c\u3055\u305b\u305f\u3044\u3002\u3064\u307e\u308a #!\/usr\/bin\/php \u3068 1 \u884c\u76ee\u306b\u66f8\u3044\u305f php \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3055\u305b\u305f\u3044\u3002 \u3046\u3061\u306e\u74b0\u5883\u3067\u306f\u3001cygwin \u4e0a\u306e &hellip; <a href=\"http:\/\/appsweets.net\/blog\/2013\/09\/02\/php-in-cygwin\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11,30],"class_list":["post-1138","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-cygwin","tag-php"],"_links":{"self":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/1138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/comments?post=1138"}],"version-history":[{"count":7,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/1138\/revisions"}],"predecessor-version":[{"id":1145,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/1138\/revisions\/1145"}],"wp:attachment":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/media?parent=1138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/categories?post=1138"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/tags?post=1138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}