{"id":8452,"date":"2018-06-10T17:58:37","date_gmt":"2018-06-10T08:58:37","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=8452"},"modified":"2018-06-23T02:04:24","modified_gmt":"2018-06-22T17:04:24","slug":"laravel-4-%e3%82%92-php-7-%e7%92%b0%e5%a2%83%e3%81%b8%e7%a7%bb%e8%a1%8c%e3%81%97%e3%81%9f%e3%81%8a%e8%a9%b1%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=8452","title":{"rendered":"Laravel 4 \u3092 PHP 7 \u74b0\u5883\u3078\u79fb\u884c\u3057\u305f\u304a\u8a71\u3002"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-8515\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/laravel.png\" alt=\"\" width=\"550\" height=\"174\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/laravel.png 1200w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/laravel-300x95.png 300w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/laravel-768x243.png 768w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/laravel-1024x324.png 1024w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<p>\u3069\u3082\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u3068\u3042\u308bWeb\u30b5\u30fc\u30d3\u30b9\u3092Laravel4\u3067\u4f5c\u6210\u3057\u305f\u306f\u3044\u3044\u304c\u9577\u5e74\u653e\u7f6e\u3057\u3066\u3044\u3066\u3044\u305f\u306e\u3067\u3001<\/p>\n<p>\u30b5\u30fc\u30d0\u30fc\u74b0\u5883\u3082<strong>\u3055\u304f\u3089\u30b5\u30fc\u30d0\u30fc<\/strong>\u304b\u3089\u3001<strong>conoha<\/strong>\u3078\u3068\u79fb\u52d5\u3055\u305b\u305f\u3044\u306a\u3068\u601d\u3044\u3001\u601d\u3044\u5207\u3063\u3066\u884c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><strong>laravel4\u3092PHP7\u74b0\u5883\u3078\u3068\u79fb\u52d5<\/strong>\u3055\u305b\u3066\u898b\u305f\u8a71\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u79fb\u52d5<\/h4>\n<p>\u307e\u305a\u306f\u3001MySQL\u30c0\u30f3\u30d7\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c7\u30fc\u30bf\u3092\u307e\u308b\u3063\u3068\u30c0\u30f3\u30d7\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ mysqldump --single-transaction -u DB\u30e6\u30fc\u30b6\u540d -p DB\u540d &gt; \u51fa\u529b\u5148\u30d5\u30a1\u30a4\u30eb\u540d<\/pre>\n<p>&nbsp;<\/p>\n<p>\u65b0\u3057\u3044\u65b9\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u540c\u3058DB\u540d\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u4f5c\u6210\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ mysql&gt; create database \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d;<\/pre>\n<p>\u30c0\u30f3\u30d7\u30c7\u30fc\u30bf\u3092\u307e\u308b\u3063\u3068\u30a4\u30f3\u30dd\u30fc\u30c8\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ mysql -u \u30e6\u30fc\u30b6\u30fc\u540d -p \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d &lt; dump\u30d5\u30a1\u30a4\u30eb\u540d<\/pre>\n<p>&nbsp;<\/p>\n<p>\u305d\u306e\u307e\u307e\u3001Laravel\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30a9\u30eb\u30c0\u3092\u307e\u308b\u3054\u3068\u79fb\u52d5\u3002<\/p>\n<p>\u9069\u5f53\u306a\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u3092\u8a2d\u5b9a\u3057\u3066\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3002<\/p>\n<p>\u8868\u793a\u3059\u308b\u304b\u306a\u3002\u3002<\/p>\n<p>\u3068\u6de1\u3044\u671f\u5f85\u3092\u6301\u3063\u3066\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u30a8\u30e9\u30fc\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-8513\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/whoops.png\" alt=\"\" width=\"596\" height=\"45\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/whoops.png 991w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/whoops-300x23.png 300w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/whoops-768x58.png 768w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/p>\n<p><strong>Whoops, looks like something went wrong.<\/strong><\/p>\n<p>Whoopes!!<\/p>\n<p>&nbsp;<\/p>\n<p>\u307e\u3041\u305d\u3046\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001\u30c7\u30d0\u30c3\u30b0\u51fa\u6765\u308b\u3088\u3046\u306b\u30a8\u30e9\u30fc\u30ed\u30b0\u304c\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3002<\/p>\n<p class=\"p1\"><strong><span class=\"s1\">app\/config\/app.php<\/span><\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">'debug' =&gt; true,<\/pre>\n<h4>HTTP_USER_AGENT\u306e\u30a8\u30e9\u30fc<\/h4>\n<p>\u3069\u3046\u3084\u3089\u3001<strong>\/bootstrap\/start.php<\/strong>\u3067\u3001\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>PC\u3068\u30b9\u30de\u30db\u3067\u8868\u793a\u5207\u308a\u66ff\u3048\u3092\u884c\u3046\u305f\u3081\u306escript\u306e\u3068\u3053\u308d\u304c\u539f\u56e0\u3060\u3063\u305f\u3088\u3046\u3067\u3057\u305f\u3002<\/p>\n<p><strong>\/bootstrap\/start.php<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ua = $_SERVER&#x5B;'HTTP_USER_AGENT'];<\/pre>\n<p>\u3068\u3044\u3063\u305f\u3001\u30e6\u30fc\u30b6\u30fc\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u53d6\u5f97\u306e\u30b5\u30fc\u30d0\u30fc\u5909\u6570\u3067\u30b3\u30b1\u3066\u3044\u308b\u69d8\u5b50\u3002<\/p>\n<p>\u3069\u3046\u3084\u3089\u3001FastCGI\u306ephp-fpm\u3092\u52d5\u304b\u3057\u3066\u3044\u308b\u3068\u3001\u30e6\u30fc\u30b6\u30fc\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u53d6\u5f97\u306e\u74b0\u5883\u5909\u6570\u00a0<strong>$_SERVER[&#8216;HTTP_USER_AGENT&#8217;];<\/strong>\u304c\u4f7f\u7528\u3067\u304d\u306a\u3044\u3068\u304b\u3068\u304b\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001nginx\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><strong>\/etc\/nginx\/nginx.conf<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">location ~ \\.php$ {\r\n  ...\r\n  fastcgi_param\u00a0 HTTP_USER_AGENT\u00a0$http_user_agent;\r\n  ...\r\n}<\/pre>\n<p>\u3075\u3080\u3002\u3053\u308c\u3067\u5927\u4e08\u592b\u3060\u308d\u3046\u3068\u3001nginx\u3092\u518d\u8d77\u52d5\u3002<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ systemctl restart nginx.service || sudo systemctl status nginx.service -l<\/pre>\n<p>&nbsp;<\/p>\n<p>\u78ba\u8a8d\u3059\u308b\u3068\u3001\u4f9d\u7136\u3068\u3057\u3066\u74b0\u5883\u5909\u6570\u00a0<strong>$_SERVER[&#8216;HTTP_USER_AGENT&#8217;];<\/strong>\u3067\u3001\u672a\u3060\u30b3\u30b1\u3066\u3044\u308b\u3002<\/p>\n<p>\u3075\u30fc\u3080\u3002<\/p>\n<p>\u8abf\u3079\u3066\u3044\u308b\u3068\u3001\u300c<strong>HTTP_USER_AGENT<\/strong>\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u4f7f\u7528\u3067\u304d\u306a\u3044\u3002\u3068\u304b\u3068\u304b\u3002<\/p>\n<p>\u672c\u5f53\u306a\u306e\u304b\uff1f\uff1f<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001\u5225\u540d\u306e\u74b0\u5883\u5909\u6570\u3092\u8a2d\u5b9a\u3002<\/p>\n<p><strong><span class=\"s1\">\/etc\/nginx\/nginx.conf<\/span><\/strong><br \/>\nlocation ~ \\.php$ {<br \/>\n\u00a0 &#8230;<br \/>\n  fastcgi_param  HTTP_UA  $http_user_agent;<br \/>\n  &#8230;<br \/>\n}<\/p>\n<p>\u3075\u3080\u3002\u3044\u3044\u52a0\u6e1b\u3053\u308c\u3067\u5927\u4e08\u592b\u3060\u308d\u3046\u3068\u3001nginx\u3092\u518d\u8d77\u52d5\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u30c0\u30e1\u3060\uff5e\u3002<\/p>\n<p>\u66f4\u306b\u8abf\u3079\u3066\u3044\u304f\u3068\u3001\u300cisset\u300d\u95a2\u6570\u3067\u3001\u5b58\u5728\u5224\u5b9a\u884c\u3048\u3070\u826f\u3044\u3068\u8a00\u3046\u60c5\u5831\u3092\u5f97\u3066\u3001\u3053\u3061\u3089\u3067\u5224\u5b9a\u3059\u308b\u3068\u3053\u308d<\/p>\n<p>&nbsp;<\/p>\n<p><strong>isset \u95a2\u6570\u7528\u3044\u305f\u5f62\u306b\u4fee\u6b63\u3002<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if(isset( $_SERVER&#x5B;'HTTP_USER_AGENT'])) {<\/pre>\n<p>\u518d\u3073\u30a2\u30af\u30bb\u30b9\u3002<\/p>\n<p>\u3084\u3063\u3068\u3001\u30a8\u30e9\u30fc\u304c\u6d88\u3048\u305f\u3002<\/p>\n<p>\u304c\u3001\u3053\u3093\u3069\u306f\u5225\u306e\u30a8\u30e9\u30fc\u304c\u3002\u3002\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>Function mcrypt_decrypt() is deprecated<\/h4>\n<p>&nbsp;<\/p>\n<p class=\"exc-title\"><strong><span class=\"exc-title-primary\">ErrorException<\/span><\/strong><\/p>\n<p class=\"exc-message\"><strong>Function mcrypt_decrypt() is deprecated<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8518\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/c45693e4b48eeab8ad0c5d2a1a837a8b.png\" alt=\"\" width=\"361\" height=\"81\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/c45693e4b48eeab8ad0c5d2a1a837a8b.png 361w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/c45693e4b48eeab8ad0c5d2a1a837a8b-300x67.png 300w\" sizes=\"auto, (max-width: 361px) 100vw, 361px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8519\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/421b511baa26bf0e4f120d4188757ccd.png\" alt=\"\" width=\"561\" height=\"84\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/421b511baa26bf0e4f120d4188757ccd.png 561w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/06\/421b511baa26bf0e4f120d4188757ccd-300x45.png 300w\" sizes=\"auto, (max-width: 561px) 100vw, 561px\" \/><\/p>\n<p>\u3046\u3093\uff1f\u4f55\u3060\u3053\u306e\u30a8\u30e9\u30fc\u3002<\/p>\n<p>\u30e9\u30a4\u30d6\u30e9\u30ea\uff08Laravel\uff09\u5074\u3067\u30b3\u30b1\u3066\u3044\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30af\u30ea\u30a2\u3057\u3066\u307f\u308b\u3002<\/p>\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u30af\u30ea\u30a2\u30b3\u30de\u30f3\u30c9 \u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u308a\u76f4\u3059<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ composer dump-autoload\r\n$ php artisan clear-compiled\r\n$ php artisan optimize\r\n$ php artisan config:cache<\/pre>\n<p>\u3068\u3001\u884c\u3063\u3066\u307f\u305f\u304c\u3001\u7279\u306b\u5909\u5316\u306f\u306a\u304f\u3002\u3002<\/p>\n<p>\u624b\u52d5\u3067\u3082\u524a\u9664\u3057\u3066\u307f\u308b\u3002<\/p>\n<p>cache\u304c\u6b8b\u3063\u3066\u3044\u308b\u30a8\u30ea\u30a2<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\/laravel\/bootstrap\/cache\/\r\n\/laravel\/storage\/framework\/cache\/<\/pre>\n<p>\u4e0a\u8a18\u306e\u5404\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067 rm -rf *.php \u3092\u5b9f\u884c\u3002<\/p>\n<p>\u3046\u30fc\u3093\u3002\u3053\u308c\u307e\u305f\u7279\u306b\u5909\u5316\u306f\u306a\u304f\u3002\u3002<\/p>\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u306a\u3069\u30af\u30ea\u30a2\u3057\u3066\u3082\u30c0\u30e1\u3060\u306a\u3002\u3002<\/p>\n<p>\u518d\u3073\u3001\u8272\u3005\u8abf\u3079\u305f\u7d50\u679c\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001\u300c<strong>mcrypt_decrypt<\/strong>\u300d\u975e\u63a8\u5968\u95a2\u6570\u306f <strong>PHP 7.1.0 \u3067\u00a0\u975e\u63a8\u5968\u3068\u306a\u308a\u3001PHP 7.2.0 \u3067\u524a\u9664<\/strong>\u00a0\u3055\u308c\u305f\u3068\u306e\u3053\u3068\u3002<\/p>\n<p>\u304a\u3002\u304a\u3046\u3002<\/p>\n<p>\u307e\u305f\u3001<strong>mcrypt\u30e2\u30b8\u30e5\u30fc\u30eb\u308210\u5e74\u4ee5\u4e0a\u307e\u3063\u305f\u304f\u30e1\u30f3\u30c6\u3055\u308c\u3066\u3044\u306a\u3044\u3068\u3044\u3046\u7406\u7531\u3067\u524a\u9664<\/strong>\u3055\u308c\u305f\u3068\u3044\u3046\u3053\u3068\u3002<\/p>\n<p>\u304a\u3002\u304a\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3046\u30fc\u3093\u3002\u3002<\/p>\n<p>\u3069\u3046\u3057\u3088\u3046\u3002\u3002<\/p>\n<p>\u3068\u3001\u3053\u308c\u307e\u305f\u8272\u3005\u8abf\u3079\u305f\u7d50\u679c\u3002<\/p>\n<p>\u3069\u3046\u3084\u3089\u3001\u3053\u3061\u3089\u306e\u4e00\u6587\u3092\u5165\u529b\u3059\u308c\u3070\u89e3\u6c7a\u3059\u308b\u307f\u305f\u3044\u3002<\/p>\n<p><strong>error_reporting(E_ALL ^ E_DEPRECATED);<\/strong><\/p>\n<p><strong>app\/config\/app.php<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">error_reporting(E_ALL ^ E_DEPRECATED);<\/pre>\n<p>&nbsp;<\/p>\n<p>\u300c<strong>app\/config\/app.php<\/strong>\u300d\u306b\u4e0a\u8a18\u3092\u8ffd\u52a0\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u3053\u3061\u3089\u3067\u3069\u3046\u3060\uff01\uff01<\/p>\n<p>\u30ad\u30bf\u30fc<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001DNS\u306e\u79fb\u884c\u3082\u3057\u3066\u7121\u4e8b\u3001Laravel\u306e\u79fb\u884c\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3053\u305d\u3053\u6642\u9593\u3092\u4f7f\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u308f\u3067\u306f\u3041\u3002<\/p>\n<p>\u7d42\u308f\u308a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3082\u3067\u3059\u3002 \u4eca\u56de\u306f\u3001\u3068\u3042\u308bWeb\u30b5\u30fc\u30d3\u30b9\u3092Laravel4\u3067\u4f5c\u6210\u3057\u305f\u306f\u3044\u3044\u304c\u9577\u5e74\u653e\u7f6e\u3057\u3066\u3044\u3066\u3044\u305f\u306e\u3067\u3001 \u30b5\u30fc\u30d0\u30fc\u74b0\u5883\u3082\u3055\u304f\u3089\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u3001conoha\u3078\u3068\u79fb\u52d5\u3055\u305b\u305f\u3044\u306a\u3068\u601d\u3044\u3001\u601d\u3044\u5207\u3063\u3066\u884c\u3063\u3066\u307f\u307e\u3057\u305f\u3002 laravel4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[37,47,179,169,107,180,173,150,44,45,78,114,118],"class_list":{"0":"post-8452","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-php","7":"tag-iphone-","8":"tag-javascript-2","9":"tag-jquery","10":"tag-mac","11":"tag-mamp","12":"tag-mysql","13":"tag-php","14":"tag-vagrant","15":"tag-web","17":"tag-78","18":"tag-114","19":"tag-118"},"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/8452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8452"}],"version-history":[{"count":16,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/8452\/revisions"}],"predecessor-version":[{"id":8521,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/8452\/revisions\/8521"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}