- 投稿日:2019-03-18T22:21:56+09:00
簡素なログインプログラム(パスワード認証のCGI)の作成
Abstract
Web通信やサーバーの動きの理解の一助のため、
「ただログインするだけのWebページを作ってみるとよい」
という助言を受け、実行してみることにした。ログイン画面のhtmlは簡単にできたが、
本丸のバックエンドプログラムの作成でてこづっている。ここでは、
「パスワード認証をするだけの簡素なCGI」
を作ることを目標にして、同時進行で様子をレポートしていきたいと思う。自己紹介
プログラミング経験数週間の初心者。簡単なスマホアプリを作ることを目標にしています。
仕事にするかはわからないが、とにかく知識や技術をつけて、生きる力にしたいと思っています。要件定義
・パスワード認証機能(管理人が定めた固定パスワードによるもの)
設計
1.ログインページのhtml(login.html)のformタグのメソッド"POST"を使ってブラウザによって送られてきたパスワード入力情報を、サーバーのCGI(login.php)にて受け取る。
2.受け取ったパスワード入力が、管理人が定めたパスワード"mintia"と一致するかどうか確かめ、
一致する場合はブラウザにログイン先のページ(youkoso.html)を返して、
一致しない場合はブラウザに「パスワードが間違っています」と表示させる。
- 投稿日:2019-03-18T20:13:34+09:00
【WordPress】分割された記事(投稿)の最後のページかどうかを判定する
記事分割した時、カスタムフィールドで追加した項目を記事の一番最後にだけ表示させる
記事を分割した際に、最後のページだけコンテンツを表示させるために、
記事の最後のページかを判定する関数がWordPressの標準関数であるのかと思ったらなかった。
(is_paged()
がそうかと思ったらアーカイブページとかで使う用でした)
なんでそれ用の関数を作ってみました。ソース
テーマ以下のfunctions.phpに以下を追加
functions.php// 投稿ページの分割ページの最後か function is_post_page_end() { global $numpages; $paged = (get_query_var('page')) ? get_query_var('page') : 1; return $paged == $numpages; }使用例
分割された記事の最後のページだと
true
が返りますsingle.php<?php if ( is_post_page_end() ) : ?> <p>この記事はこのページで最後です。</p> <?php endif; ?>おわり
- もしかすると調べ切れてないだけで標準関数あったりするんですかね?
- 投稿日:2019-03-18T15:01:50+09:00
AI-Techservices - AI Solutions Development Company
AI Techservices is the top grade Artificial Intelligence software development company specialized in AI development of Machine Learning and Deep Learning Solutions for enterprises.
Click Here To Visit The Site: https://www.ai-techservices.com/
- 投稿日:2019-03-18T08:20:34+09:00
php-master-changes 2019-03-17
今日はビルドシステムのリファクタリングがあった!
2019-03-17
nunoplopes: check for bison binary, not yacc
- https://github.com/php/php-src/commit/495a46aa1dc564656bf919cb49aae48a31ae15f4
- [7.4~]
- ビルドシステムで、AC_PROG_YACC を AC_CHECKPROG で bison をチェックする形に修正
- Bison 3.3 で bison -y の挙動が厳格化されて posix yacc に沿わないコードを弾くようになったらしい
petk: [ci skip] Remove make install step from README
- https://github.com/php/php-src/commit/86f2681460c7ebd28eefc82f32b879e1e26454c9
- [7.4~]
- README の「ソースからのビルド」の項から make install の部分を削除
- 他のとこに詳しく書くべきでないか、ということらしい
nunoplopes: snmp: remove unused var
- https://github.com/php/php-src/commit/2619b138c0f3fe501f2b5b3924244237f02b7042
- [7.4~]
- 昨日の修正の 7.4 へのバックポート
- やった人が git 移行後の PHP のワークフロー(下位バージョンのブランチに当ててから上位バージョンへマージしていく)に慣れてない人だったのでこうなった
- 今だと開発版が 7.4 と 8.0 と両方あって、8.0 専用の修正以外には常に必要だしな
petk: Enhance the buildconf script
- https://github.com/php/php-src/commit/78ab79b9164420679da7aba1f7195335d656afda
- [7.4~]
- ビルドシステムで、buildconf を改善
- 何をやるスクリプトなのかの説明を追加
- -h、--help の追加
- メッセージを修正して次に何やればいいか分かるように
- 他ディレクトリから実行できるよう、実行時にプロジェクトルートへ cd するよう修正
- make があるかのチェック追加
- petk の人、これ系の開発環境の地ならしでめっっっっっっっっちゃ色々頑張ってて、またコミットメッセージが丁寧でほぼ毎度元実装の背景調査して変更理由きっちり書いてて、開発への参入障壁下げ続けてるので、機能面は全然触ってない人だけど長い目で見て結構なヒーローだと思う
petk: Move distribution generator script to scripts/dev
- https://github.com/php/php-src/commit/e525ce30a56767cb5bd71221dd98bdc09f3ee60f
- [7.4~]
- ビルドシステムで、makedist、genfiles をプロジェクトルートから scripts/dev へ移動
- プロジェクトルートに入るもの限定した方がとりあえず何見ればいいか分かりやすく、リリース/パッケージ用スクリプトは普通の人そんなに使わないでしょ、ということらしい
- 実際現状でかなりスッキリしてて、5.6系のを比較用に見ると、おーという気持ちになる
- あとドキュメント系を整理できればもっと減りそう
petk: Remove duplicate PHP_C_BIGENDIAN check
- https://github.com/php/php-src/commit/20af19b9b3cbaf2821e56a4252c3b946e04b3190
- [7.4~]
- ext/hash で、config.m4 の不要な PHP_C_BIGENDIAN を削除
- ビッグエンディアンチェックは configure.ac で済んでるから、ということらしい
nunoplopes: remove unneeded AC_REQUIRE([AC_PROG_YACC])
- https://github.com/php/php-src/commit/33d428252699b679e420d414507fb0c5db4b3eac
- [7.4~]
- ビルドシステムで、不要な AC_REQUIRE([AC_PROG_YACC]) を削除
- 「これもいらないんじゃない?」とコミットへのコメントで petk の人が言ってた奴
- 投稿日:2019-03-18T04:14:50+09:00
【トラブルシューティング】xamppにおけるPHP7.3を使ってSymfonyをインストール
はじめに
今回のエラー
ProjectsというフォルダにSymfonyのインストローラーをインストールしようとしたところ…
C:\>cd Projects C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar以下のようなエラーが出た。
PHP Warning: failed loading cafile stream: `C:\xampp\apache\bin\curl-ca-bundle.crt' in Command line code on line 1 PHP Warning: readfile(): Failed to enable crypto in Command line code on line 1 PHP Warning: readfile(http://symfony.com/installer): failed to open stream: operation failed in Command line code on line 1以下のサイト
⇒https://curl.haxx.se/docs/caextract.html
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar C:\Projects>php symfony.pharインストーラーをインストールできた。
```
Symfony Installer (1.5.11)
==========================This is the official installer to start new projects based on the
Symfony full-stack framework.To create a new project called blog in the current directory using
the latest stable version of Symfony, execute the following command:symfony.phar new blog
Create a project based on the Symfony Long Term Support version (LTS):
symfony.phar new blog lts
Create a project based on a specific Symfony branch:
symfony.phar new blog 2.8 or symfony.phar new blog 3.0
Create a project based on a specific Symfony version:
symfony.phar new blog 2.8.1 or symfony.phar new blog 3.0.1
Create a demo application to learn how a Symfony application works:
symfony.phar demo
Updating the Symfony Installer
New versions of the Symfony Installer are released regularly. To update your
installer version, execute the following command:symfony.phar self-update
C:\Projects>php symfony.phar new classic-symfony 3.4
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357
Downloading Symfony...
0 B/6.3 MiB >----------------------------------------------------------- 0% 16 KiB/6.3 MiB >----------------------------------------------------------- 0% 33 KiB/6.3 MiB >----------------------------------------------------------- 0% 49 KiB/6.3 MiB >----------------------------------------------------------- 0% 63 KiB/6.3 MiB >----------------------------------------------------------- 0% 71 KiB/6.3 MiB >----------------------------------------------------------- 1% 87 KiB/6.3 MiB >----------------------------------------------------------- 1% 103 KiB/6.3 MiB >----------------------------------------------------------- 1% 119 KiB/6.3 MiB =>---------------------------------------------------------- 1% 135 KiB/6.3 MiB =>---------------------------------------------------------- 2% 148 KiB/6.3 MiB =>---------------------------------------------------------- 2% 164 KiB/6.3 MiB =>---------------------------------------------------------- 2% 177 KiB/6.3 MiB =>---------------------------------------------------------- 2% 192 KiB/6.3 MiB =>---------------------------------------------------------- 2% 199 KiB/6.3 MiB =>---------------------------------------------------------- 3% 215 KiB/6.3 MiB ==>--------------------------------------------------------- 3% 231 KiB/6.3 MiB ==>--------------------------------------------------------- 3% 243 KiB/6.3 MiB ==>--------------------------------------------------------- 3% 259 KiB/6.3 MiB ==>--------------------------------------------------------- 4% 275 KiB/6.3 MiB ==>--------------------------------------------------------- 4% 278 KiB/6.3 MiB ==>--------------------------------------------------------- 4% 287 KiB/6.3 MiB ==>--------------------------------------------------------- 4% 303 KiB/6.3 MiB ==>--------------------------------------------------------- 4% 308 KiB/6.3 MiB ==>--------------------------------------------------------- 4% 324 KiB/6.3 MiB ===>-------------------------------------------------------- 5% 345 KiB/6.3 MiB ===>-------------------------------------------------------- 5% 359 KiB/6.3 MiB ===>-------------------------------------------------------- 5% 367 KiB/6.3 MiB ===>-------------------------------------------------------- 5% 383 KiB/6.3 MiB ===>-------------------------------------------------------- 5% 393 KiB/6.3 MiB ===>-------------------------------------------------------- 6% 400 KiB/6.3 MiB ===>-------------------------------------------------------- 6% 412 KiB/6.3 MiB ===>-------------------------------------------------------- 6% 416 KiB/6.3 MiB ===>-------------------------------------------------------- 6% 427 KiB/6.3 MiB ===>-------------------------------------------------------- 6% 432 KiB/6.3 MiB ====>------------------------------------------------------- 6% 443 KiB/6.3 MiB ====>------------------------------------------------------- 6% 459 KiB/6.3 MiB ====>------------------------------------------------------- 7% 470 KiB/6.3 MiB ====>------------------------------------------------------- 7% 486 KiB/6.3 MiB ====>------------------------------------------------------- 7% 502 KiB/6.3 MiB ====>------------------------------------------------------- 7% 505 KiB/6.3 MiB ====>------------------------------------------------------- 7% 514 KiB/6.3 MiB ====>------------------------------------------------------- 7% 523 KiB/6.3 MiB ====>------------------------------------------------------- 8% 539 KiB/6.3 MiB ====>------------------------------------------------------- 8% 556 KiB/6.3 MiB =====>------------------------------------------------------ 8% 572 KiB/6.3 MiB =====>------------------------------------------------------ 8% 584 KiB/6.3 MiB =====>------------------------------------------------------ 9% 600 KiB/6.3 MiB =====>------------------------------------------------------ 9% 606 KiB/6.3 MiB =====>------------------------------------------------------ 9% 622 KiB/6.3 MiB =====>------------------------------------------------------ 9% 642 KiB/6.3 MiB =====>------------------------------------------------------ 9% 658 KiB/6.3 MiB ======>----------------------------------------------------- 10% 674 KiB/6.3 MiB ======>----------------------------------------------------- 10% 689 KiB/6.3 MiB ======>----------------------------------------------------- 10% 701 KiB/6.3 MiB ======>----------------------------------------------------- 10% 721 KiB/6.3 MiB ======>----------------------------------------------------- 11% 733 KiB/6.3 MiB ======>----------------------------------------------------- 11% 753 KiB/6.3 MiB ======>----------------------------------------------------- 11% 769 KiB/6.3 MiB =======>---------------------------------------------------- 11% 785 KiB/6.3 MiB =======>---------------------------------------------------- 12% 801 KiB/6.3 MiB =======>---------------------------------------------------- 12% 817 KiB/6.3 MiB =======>---------------------------------------------------- 12% 833 KiB/6.3 MiB =======>---------------------------------------------------- 12% 845 KiB/6.3 MiB =======>---------------------------------------------------- 13% 862 KiB/6.3 MiB =======>---------------------------------------------------- 13% 878 KiB/6.3 MiB ========>--------------------------------------------------- 13% 890 KiB/6.3 MiB ========>--------------------------------------------------- 13% 906 KiB/6.3 MiB ========>--------------------------------------------------- 13% 922 KiB/6.3 MiB ========>--------------------------------------------------- 14% 933 KiB/6.3 MiB ========>--------------------------------------------------- 14% 949 KiB/6.3 MiB ========>--------------------------------------------------- 14% 965 KiB/6.3 MiB ========>--------------------------------------------------- 14% 981 KiB/6.3 MiB =========>-------------------------------------------------- 15% 986 KiB/6.3 MiB =========>-------------------------------------------------- 15%1002 KiB/6.3 MiB =========>-------------------------------------------------- 15%
1003 KiB/6.3 MiB =========>-------------------------------------------------- 15%
1012 KiB/6.3 MiB =========>-------------------------------------------------- 15%
1022 KiB/6.3 MiB =========>-------------------------------------------------- 15%
1.0 MiB/6.3 MiB =========>-------------------------------------------------- 15%
1.0 MiB/6.3 MiB =========>-------------------------------------------------- 16%
1.0 MiB/6.3 MiB =========>-------------------------------------------------- 16%
1.0 MiB/6.3 MiB =========>-------------------------------------------------- 16%
1.0 MiB/6.3 MiB =========>-------------------------------------------------- 16%
1.1 MiB/6.3 MiB ==========>------------------------------------------------- 16%
1.1 MiB/6.3 MiB ==========>------------------------------------------------- 16%
1.1 MiB/6.3 MiB ==========>------------------------------------------------- 17%
1.1 MiB/6.3 MiB ==========>------------------------------------------------- 17%
1.1 MiB/6.3 MiB ==========>------------------------------------------------- 17%
1.1 MiB/6.3 MiB ==========>------------------------------------------------- 17%
1.2 MiB/6.3 MiB ==========>------------------------------------------------- 18%
1.2 MiB/6.3 MiB ===========>------------------------------------------------ 18%
1.2 MiB/6.3 MiB ===========>------------------------------------------------ 18%
1.2 MiB/6.3 MiB ===========>------------------------------------------------ 18%
1.2 MiB/6.3 MiB ===========>------------------------------------------------ 19%
1.2 MiB/6.3 MiB ===========>------------------------------------------------ 19%
1.2 MiB/6.3 MiB ===========>------------------------------------------------ 19%
1.3 MiB/6.3 MiB ===========>------------------------------------------------ 19%
1.3 MiB/6.3 MiB ============>----------------------------------------------- 20%
1.3 MiB/6.3 MiB ============>----------------------------------------------- 20%
1.3 MiB/6.3 MiB ============>----------------------------------------------- 20%
1.3 MiB/6.3 MiB ============>----------------------------------------------- 20%
1.3 MiB/6.3 MiB ============>----------------------------------------------- 21%
1.4 MiB/6.3 MiB ============>----------------------------------------------- 21%
1.4 MiB/6.3 MiB ============>----------------------------------------------- 21%
1.4 MiB/6.3 MiB =============>---------------------------------------------- 21%
1.4 MiB/6.3 MiB =============>---------------------------------------------- 21%
1.4 MiB/6.3 MiB =============>---------------------------------------------- 22%
1.4 MiB/6.3 MiB =============>---------------------------------------------- 22%
1.4 MiB/6.3 MiB =============>---------------------------------------------- 22%
1.4 MiB/6.3 MiB =============>---------------------------------------------- 22%
1.4 MiB/6.3 MiB =============>---------------------------------------------- 22%
1.5 MiB/6.3 MiB =============>---------------------------------------------- 23%
1.5 MiB/6.3 MiB ==============>--------------------------------------------- 23%
1.5 MiB/6.3 MiB ==============>--------------------------------------------- 23%
1.5 MiB/6.3 MiB ==============>--------------------------------------------- 23%
1.5 MiB/6.3 MiB ==============>--------------------------------------------- 24%
1.5 MiB/6.3 MiB ==============>--------------------------------------------- 24%
1.5 MiB/6.3 MiB ==============>--------------------------------------------- 24%
1.6 MiB/6.3 MiB ==============>--------------------------------------------- 24%
1.6 MiB/6.3 MiB ==============>--------------------------------------------- 24%
1.6 MiB/6.3 MiB ===============>-------------------------------------------- 25%
1.6 MiB/6.3 MiB ===============>-------------------------------------------- 25%
1.6 MiB/6.3 MiB ===============>-------------------------------------------- 25%
1.6 MiB/6.3 MiB ===============>-------------------------------------------- 25%
1.7 MiB/6.3 MiB ===============>-------------------------------------------- 26%
1.7 MiB/6.3 MiB ===============>-------------------------------------------- 26%
1.7 MiB/6.3 MiB ===============>-------------------------------------------- 26%
1.7 MiB/6.3 MiB ================>------------------------------------------- 26%
1.7 MiB/6.3 MiB ================>------------------------------------------- 27%
1.7 MiB/6.3 MiB ================>------------------------------------------- 27%
1.7 MiB/6.3 MiB ================>------------------------------------------- 27%
1.8 MiB/6.3 MiB ================>------------------------------------------- 27%
1.8 MiB/6.3 MiB ================>------------------------------------------- 28%
1.8 MiB/6.3 MiB =================>------------------------------------------ 28%
1.8 MiB/6.3 MiB =================>------------------------------------------ 28%
1.8 MiB/6.3 MiB =================>------------------------------------------ 28%
1.8 MiB/6.3 MiB =================>------------------------------------------ 29%
1.9 MiB/6.3 MiB =================>------------------------------------------ 29%
1.9 MiB/6.3 MiB =================>------------------------------------------ 29%
1.9 MiB/6.3 MiB =================>------------------------------------------ 29%
1.9 MiB/6.3 MiB ==================>----------------------------------------- 30%
1.9 MiB/6.3 MiB ==================>----------------------------------------- 30%
1.9 MiB/6.3 MiB ==================>----------------------------------------- 30%
1.9 MiB/6.3 MiB ==================>----------------------------------------- 30%
2.0 MiB/6.3 MiB ==================>----------------------------------------- 31%
2.0 MiB/6.3 MiB ==================>----------------------------------------- 31%
2.0 MiB/6.3 MiB ==================>----------------------------------------- 31%
2.0 MiB/6.3 MiB ===================>---------------------------------------- 31%
2.0 MiB/6.3 MiB ===================>---------------------------------------- 32%
2.0 MiB/6.3 MiB ===================>---------------------------------------- 32%
2.1 MiB/6.3 MiB ===================>---------------------------------------- 32%
2.1 MiB/6.3 MiB ===================>---------------------------------------- 32%
2.1 MiB/6.3 MiB ===================>---------------------------------------- 33%
2.1 MiB/6.3 MiB ===================>---------------------------------------- 33%
2.1 MiB/6.3 MiB ====================>--------------------------------------- 33%
2.1 MiB/6.3 MiB ====================>--------------------------------------- 33%
2.2 MiB/6.3 MiB ====================>--------------------------------------- 34%
2.2 MiB/6.3 MiB ====================>--------------------------------------- 34%
2.2 MiB/6.3 MiB ====================>--------------------------------------- 34%
2.2 MiB/6.3 MiB ====================>--------------------------------------- 34%
2.2 MiB/6.3 MiB =====================>-------------------------------------- 35%
2.2 MiB/6.3 MiB =====================>-------------------------------------- 35%
2.2 MiB/6.3 MiB =====================>-------------------------------------- 35%
2.3 MiB/6.3 MiB =====================>-------------------------------------- 35%
2.3 MiB/6.3 MiB =====================>-------------------------------------- 36%
2.3 MiB/6.3 MiB =====================>-------------------------------------- 36%
2.3 MiB/6.3 MiB =====================>-------------------------------------- 36%
2.3 MiB/6.3 MiB ======================>------------------------------------- 36%
2.3 MiB/6.3 MiB ======================>------------------------------------- 37%
2.4 MiB/6.3 MiB ======================>------------------------------------- 37%
2.4 MiB/6.3 MiB ======================>------------------------------------- 37%
2.4 MiB/6.3 MiB ======================>------------------------------------- 37%
2.4 MiB/6.3 MiB ======================>------------------------------------- 38%
2.4 MiB/6.3 MiB ======================>------------------------------------- 38%
2.4 MiB/6.3 MiB =======================>------------------------------------ 38%
2.4 MiB/6.3 MiB =======================>------------------------------------ 38%
2.5 MiB/6.3 MiB =======================>------------------------------------ 38%
2.5 MiB/6.3 MiB =======================>------------------------------------ 39%
2.5 MiB/6.3 MiB =======================>------------------------------------ 39%
2.5 MiB/6.3 MiB =======================>------------------------------------ 39%
2.5 MiB/6.3 MiB =======================>------------------------------------ 39%
2.5 MiB/6.3 MiB ========================>----------------------------------- 40%
2.6 MiB/6.3 MiB ========================>----------------------------------- 40%
2.6 MiB/6.3 MiB ========================>----------------------------------- 40%
2.6 MiB/6.3 MiB ========================>----------------------------------- 40%
2.6 MiB/6.3 MiB ========================>----------------------------------- 41%
2.6 MiB/6.3 MiB ========================>----------------------------------- 41%
2.6 MiB/6.3 MiB =========================>---------------------------------- 41%
2.7 MiB/6.3 MiB =========================>---------------------------------- 41%
2.7 MiB/6.3 MiB =========================>---------------------------------- 42%
2.7 MiB/6.3 MiB =========================>---------------------------------- 42%
2.7 MiB/6.3 MiB =========================>---------------------------------- 42%
2.7 MiB/6.3 MiB =========================>---------------------------------- 42%
2.7 MiB/6.3 MiB =========================>---------------------------------- 43%
2.7 MiB/6.3 MiB ==========================>--------------------------------- 43%
2.8 MiB/6.3 MiB ==========================>--------------------------------- 43%
2.8 MiB/6.3 MiB ==========================>--------------------------------- 43%
2.8 MiB/6.3 MiB ==========================>--------------------------------- 44%
2.8 MiB/6.3 MiB ==========================>--------------------------------- 44%
2.8 MiB/6.3 MiB ==========================>--------------------------------- 44%
2.8 MiB/6.3 MiB ==========================>--------------------------------- 44%
2.9 MiB/6.3 MiB ===========================>-------------------------------- 45%
2.9 MiB/6.3 MiB ===========================>-------------------------------- 45%
2.9 MiB/6.3 MiB ===========================>-------------------------------- 45%
2.9 MiB/6.3 MiB ===========================>-------------------------------- 45%
2.9 MiB/6.3 MiB ===========================>-------------------------------- 46%
2.9 MiB/6.3 MiB ===========================>-------------------------------- 46%
2.9 MiB/6.3 MiB ===========================>-------------------------------- 46%
3.0 MiB/6.3 MiB ============================>------------------------------- 46%
3.0 MiB/6.3 MiB ============================>------------------------------- 47%
3.0 MiB/6.3 MiB ============================>------------------------------- 47%
3.0 MiB/6.3 MiB ============================>------------------------------- 47%
3.0 MiB/6.3 MiB ============================>------------------------------- 47%
3.0 MiB/6.3 MiB ============================>------------------------------- 48%
3.1 MiB/6.3 MiB ============================>------------------------------- 48%
3.1 MiB/6.3 MiB =============================>------------------------------ 48%
3.1 MiB/6.3 MiB =============================>------------------------------ 48%
3.1 MiB/6.3 MiB =============================>------------------------------ 48%
3.1 MiB/6.3 MiB =============================>------------------------------ 49%
3.1 MiB/6.3 MiB =============================>------------------------------ 49%
3.1 MiB/6.3 MiB =============================>------------------------------ 49%
3.1 MiB/6.3 MiB =============================>------------------------------ 49%
3.2 MiB/6.3 MiB =============================>------------------------------ 49%
3.2 MiB/6.3 MiB ==============================>----------------------------- 50%
3.2 MiB/6.3 MiB ==============================>----------------------------- 50%
3.2 MiB/6.3 MiB ==============================>----------------------------- 50%
3.2 MiB/6.3 MiB ==============================>----------------------------- 50%
3.2 MiB/6.3 MiB ==============================>----------------------------- 51%
3.3 MiB/6.3 MiB ==============================>----------------------------- 51%
3.3 MiB/6.3 MiB ===============================>---------------------------- 51%
3.3 MiB/6.3 MiB ===============================>---------------------------- 51%
3.3 MiB/6.3 MiB ===============================>---------------------------- 52%
3.3 MiB/6.3 MiB ===============================>---------------------------- 52%
3.3 MiB/6.3 MiB ===============================>---------------------------- 52%
3.3 MiB/6.3 MiB ===============================>---------------------------- 52%
3.4 MiB/6.3 MiB ===============================>---------------------------- 53%
3.4 MiB/6.3 MiB ================================>--------------------------- 53%
3.4 MiB/6.3 MiB ================================>--------------------------- 53%
3.4 MiB/6.3 MiB ================================>--------------------------- 53%
3.4 MiB/6.3 MiB ================================>--------------------------- 54%
3.4 MiB/6.3 MiB ================================>--------------------------- 54%
3.5 MiB/6.3 MiB ================================>--------------------------- 54%
3.5 MiB/6.3 MiB ================================>--------------------------- 54%
3.5 MiB/6.3 MiB =================================>-------------------------- 55%
3.5 MiB/6.3 MiB =================================>-------------------------- 55%
3.5 MiB/6.3 MiB =================================>-------------------------- 55%
3.5 MiB/6.3 MiB =================================>-------------------------- 55%
3.5 MiB/6.3 MiB =================================>-------------------------- 56%
3.6 MiB/6.3 MiB =================================>-------------------------- 56%
3.6 MiB/6.3 MiB =================================>-------------------------- 56%
3.6 MiB/6.3 MiB ==================================>------------------------- 56%
3.6 MiB/6.3 MiB ==================================>------------------------- 57%
3.6 MiB/6.3 MiB ==================================>------------------------- 57%
3.6 MiB/6.3 MiB ==================================>------------------------- 57%
3.7 MiB/6.3 MiB ==================================>------------------------- 57%
3.7 MiB/6.3 MiB ==================================>------------------------- 58%
3.7 MiB/6.3 MiB ===================================>------------------------ 58%
3.7 MiB/6.3 MiB ===================================>------------------------ 58%
3.7 MiB/6.3 MiB ===================================>------------------------ 58%
3.7 MiB/6.3 MiB ===================================>------------------------ 59%
3.8 MiB/6.3 MiB ===================================>------------------------ 59%
3.8 MiB/6.3 MiB ===================================>------------------------ 59%
3.8 MiB/6.3 MiB ===================================>------------------------ 59%
3.8 MiB/6.3 MiB ====================================>----------------------- 60%
3.8 MiB/6.3 MiB ====================================>----------------------- 60%
3.8 MiB/6.3 MiB ====================================>----------------------- 60%
3.8 MiB/6.3 MiB ====================================>----------------------- 60%
3.9 MiB/6.3 MiB ====================================>----------------------- 61%
3.9 MiB/6.3 MiB ====================================>----------------------- 61%
3.9 MiB/6.3 MiB ====================================>----------------------- 61%
3.9 MiB/6.3 MiB =====================================>---------------------- 61%
3.9 MiB/6.3 MiB =====================================>---------------------- 62%
3.9 MiB/6.3 MiB =====================================>---------------------- 62%
4.0 MiB/6.3 MiB =====================================>---------------------- 62%
4.0 MiB/6.3 MiB =====================================>---------------------- 62%
4.0 MiB/6.3 MiB =====================================>---------------------- 63%
4.0 MiB/6.3 MiB =====================================>---------------------- 63%
4.0 MiB/6.3 MiB ======================================>--------------------- 63%
4.0 MiB/6.3 MiB ======================================>--------------------- 63%
4.0 MiB/6.3 MiB ======================================>--------------------- 64%
4.1 MiB/6.3 MiB ======================================>--------------------- 64%
4.1 MiB/6.3 MiB ======================================>--------------------- 64%
4.1 MiB/6.3 MiB ======================================>--------------------- 64%
4.1 MiB/6.3 MiB =======================================>-------------------- 65%
4.1 MiB/6.3 MiB =======================================>-------------------- 65%
4.1 MiB/6.3 MiB =======================================>-------------------- 65%
4.2 MiB/6.3 MiB =======================================>-------------------- 65%
4.2 MiB/6.3 MiB =======================================>-------------------- 66%
4.2 MiB/6.3 MiB =======================================>-------------------- 66%
4.2 MiB/6.3 MiB =======================================>-------------------- 66%
4.2 MiB/6.3 MiB ========================================>------------------- 66%
4.2 MiB/6.3 MiB ========================================>------------------- 67%
4.3 MiB/6.3 MiB ========================================>------------------- 67%
4.3 MiB/6.3 MiB ========================================>------------------- 67%
4.3 MiB/6.3 MiB ========================================>------------------- 67%
4.3 MiB/6.3 MiB ========================================>------------------- 68%
4.3 MiB/6.3 MiB ========================================>------------------- 68%
4.3 MiB/6.3 MiB =========================================>------------------ 68%
4.3 MiB/6.3 MiB =========================================>------------------ 68%
4.4 MiB/6.3 MiB =========================================>------------------ 68%
4.4 MiB/6.3 MiB =========================================>------------------ 69%
4.4 MiB/6.3 MiB =========================================>------------------ 69%
4.4 MiB/6.3 MiB =========================================>------------------ 69%
4.4 MiB/6.3 MiB =========================================>------------------ 69%
4.4 MiB/6.3 MiB ==========================================>----------------- 70%
4.5 MiB/6.3 MiB ==========================================>----------------- 70%
4.5 MiB/6.3 MiB ==========================================>----------------- 70%
4.5 MiB/6.3 MiB ==========================================>----------------- 70%
4.5 MiB/6.3 MiB ==========================================>----------------- 71%
4.5 MiB/6.3 MiB ==========================================>----------------- 71%
4.5 MiB/6.3 MiB ===========================================>---------------- 71%
4.5 MiB/6.3 MiB ===========================================>---------------- 71%
4.6 MiB/6.3 MiB ===========================================>---------------- 72%
4.6 MiB/6.3 MiB ===========================================>---------------- 72%
4.6 MiB/6.3 MiB ===========================================>---------------- 72%
4.6 MiB/6.3 MiB ===========================================>---------------- 72%
4.6 MiB/6.3 MiB ===========================================>---------------- 73%
4.6 MiB/6.3 MiB ============================================>--------------- 73%
4.7 MiB/6.3 MiB ============================================>--------------- 73%
4.7 MiB/6.3 MiB ============================================>--------------- 73%
4.7 MiB/6.3 MiB ============================================>--------------- 74%
4.7 MiB/6.3 MiB ============================================>--------------- 74%
4.7 MiB/6.3 MiB ============================================>--------------- 74%
4.7 MiB/6.3 MiB ============================================>--------------- 74%
4.8 MiB/6.3 MiB =============================================>-------------- 75%
4.8 MiB/6.3 MiB =============================================>-------------- 75%
4.8 MiB/6.3 MiB =============================================>-------------- 75%
4.8 MiB/6.3 MiB =============================================>-------------- 75%
4.8 MiB/6.3 MiB =============================================>-------------- 76%
4.8 MiB/6.3 MiB =============================================>-------------- 76%
4.8 MiB/6.3 MiB =============================================>-------------- 76%
4.9 MiB/6.3 MiB ==============================================>------------- 76%
4.9 MiB/6.3 MiB ==============================================>------------- 77%
4.9 MiB/6.3 MiB ==============================================>------------- 77%
4.9 MiB/6.3 MiB ==============================================>------------- 77%
4.9 MiB/6.3 MiB ==============================================>------------- 77%
4.9 MiB/6.3 MiB ==============================================>------------- 78%
4.9 MiB/6.3 MiB ==============================================>------------- 78%
5.0 MiB/6.3 MiB ===============================================>------------ 78%
5.0 MiB/6.3 MiB ===============================================>------------ 78%
5.0 MiB/6.3 MiB ===============================================>------------ 78%
5.0 MiB/6.3 MiB ===============================================>------------ 79%
5.0 MiB/6.3 MiB ===============================================>------------ 79%
5.0 MiB/6.3 MiB ===============================================>------------ 79%
5.0 MiB/6.3 MiB ===============================================>------------ 79%
5.1 MiB/6.3 MiB ================================================>----------- 80%
5.1 MiB/6.3 MiB ================================================>----------- 80%
5.1 MiB/6.3 MiB ================================================>----------- 80%
5.1 MiB/6.3 MiB ================================================>----------- 80%
5.1 MiB/6.3 MiB ================================================>----------- 81%
5.1 MiB/6.3 MiB ================================================>----------- 81%
5.2 MiB/6.3 MiB ================================================>----------- 81%
5.2 MiB/6.3 MiB =================================================>---------- 81%
5.2 MiB/6.3 MiB =================================================>---------- 82%
5.2 MiB/6.3 MiB =================================================>---------- 82%
5.2 MiB/6.3 MiB =================================================>---------- 82%
5.2 MiB/6.3 MiB =================================================>---------- 82%
5.3 MiB/6.3 MiB =================================================>---------- 83%
5.3 MiB/6.3 MiB =================================================>---------- 83%
5.3 MiB/6.3 MiB ==================================================>--------- 83%
5.3 MiB/6.3 MiB ==================================================>--------- 83%
5.3 MiB/6.3 MiB ==================================================>--------- 84%
5.3 MiB/6.3 MiB ==================================================>--------- 84%
5.3 MiB/6.3 MiB ==================================================>--------- 84%
5.4 MiB/6.3 MiB ==================================================>--------- 84%
5.4 MiB/6.3 MiB ===================================================>-------- 85%
5.4 MiB/6.3 MiB ===================================================>-------- 85%
5.4 MiB/6.3 MiB ===================================================>-------- 85%
5.4 MiB/6.3 MiB ===================================================>-------- 85%
5.4 MiB/6.3 MiB ===================================================>-------- 86%
5.5 MiB/6.3 MiB ===================================================>-------- 86%
5.5 MiB/6.3 MiB ===================================================>-------- 86%
5.5 MiB/6.3 MiB ====================================================>------- 86%
5.5 MiB/6.3 MiB ====================================================>------- 87%
5.5 MiB/6.3 MiB ====================================================>------- 87%
5.5 MiB/6.3 MiB ====================================================>------- 87%
5.5 MiB/6.3 MiB ====================================================>------- 87%
5.6 MiB/6.3 MiB ====================================================>------- 88%
5.6 MiB/6.3 MiB ====================================================>------- 88%
5.6 MiB/6.3 MiB =====================================================>------ 88%
5.6 MiB/6.3 MiB =====================================================>------ 88%
5.6 MiB/6.3 MiB =====================================================>------ 89%
5.6 MiB/6.3 MiB =====================================================>------ 89%
5.7 MiB/6.3 MiB =====================================================>------ 89%
5.7 MiB/6.3 MiB =====================================================>------ 89%
5.7 MiB/6.3 MiB =====================================================>------ 89%
5.7 MiB/6.3 MiB ======================================================>----- 90%
5.7 MiB/6.3 MiB ======================================================>----- 90%
5.7 MiB/6.3 MiB ======================================================>----- 90%
5.8 MiB/6.3 MiB ======================================================>----- 90%
5.8 MiB/6.3 MiB ======================================================>----- 91%
5.8 MiB/6.3 MiB ======================================================>----- 91%
5.8 MiB/6.3 MiB =======================================================>---- 91%
5.8 MiB/6.3 MiB =======================================================>---- 91%
5.8 MiB/6.3 MiB =======================================================>---- 92%
5.8 MiB/6.3 MiB =======================================================>---- 92%
5.9 MiB/6.3 MiB =======================================================>---- 92%
5.9 MiB/6.3 MiB =======================================================>---- 92%
5.9 MiB/6.3 MiB =======================================================>---- 93%
5.9 MiB/6.3 MiB ========================================================>--- 93%
5.9 MiB/6.3 MiB ========================================================>--- 93%
5.9 MiB/6.3 MiB ========================================================>--- 93%
6.0 MiB/6.3 MiB ========================================================>--- 94%
6.0 MiB/6.3 MiB ========================================================>--- 94%
6.0 MiB/6.3 MiB ========================================================>--- 94%
6.0 MiB/6.3 MiB ========================================================>--- 94%
6.0 MiB/6.3 MiB =========================================================>-- 95%
6.0 MiB/6.3 MiB =========================================================>-- 95%
6.0 MiB/6.3 MiB =========================================================>-- 95%
6.1 MiB/6.3 MiB =========================================================>-- 95%
6.1 MiB/6.3 MiB =========================================================>-- 96%
6.1 MiB/6.3 MiB =========================================================>-- 96%
6.1 MiB/6.3 MiB =========================================================>-- 96%
6.1 MiB/6.3 MiB ==========================================================>- 96%
6.1 MiB/6.3 MiB ==========================================================>- 97%
6.2 MiB/6.3 MiB ==========================================================>- 97%
6.2 MiB/6.3 MiB ==========================================================>- 97%
6.2 MiB/6.3 MiB ==========================================================>- 97%
6.2 MiB/6.3 MiB ==========================================================>- 98%
6.2 MiB/6.3 MiB ===========================================================> 98%
6.2 MiB/6.3 MiB ===========================================================> 98%
6.3 MiB/6.3 MiB ===========================================================> 98%
6.3 MiB/6.3 MiB ===========================================================> 99%
6.3 MiB/6.3 MiB ===========================================================> 99%
6.3 MiB/6.3 MiB ===========================================================> 99%
6.3 MiB/6.3 MiB ===========================================================> 99%
6.3 MiB/6.3 MiB ============================================================ 100%
6.3 MiB/6.3 MiB ============================================================ 100%
6.3 MiB/6.3 MiB ============================================================ 100%
6.3 MiB/6.3 MiB ============================================================ 100%Preparing project...
OK Symfony 3.4.23 was successfully installed. Now you can:
* Change your current directory to C:\Projects\classic-symfony * Configure your application in app/config/parameters.yml file. * Run your application: 1. Execute the php bin/console server:run command. 2. Browse to the http://localhost:8000 URL. * Read the documentation at https://symfony.com/docC:\Projects>
- 投稿日:2019-03-18T04:14:50+09:00
【エラー解決法】xamppにおけるPHP7.3を使ってSymfony3.4をインストール
はじめに
ProjectsというフォルダにSymfonyのインストローラをダウンロードしようとしたところ・・・
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar次のエラーが出た。
これは、『curl-ca-bundle.crt』という名のSSL証明書が見つからないという意味らしい。PHP Warning: failed loading cafile stream: `C:\xampp\apache\bin\curl-ca-bundle.crt' in Command line code on line 1 PHP Warning: readfile(): Failed to enable crypto in Command line code on line 1 PHP Warning: readfile(http://symfony.com/installer): failed to open stream: operation failed in Command line code on line 1(1)SSL証明のダウンロード
赤枠をクリックし、SSL証明書をダウンロードする。
リンク:https://curl.haxx.se/docs/caextract.html
(2)SSL証明書を指定のフォルダに置く
cacert.pemをca-bundle-curl.crtというファイル名に変更。
『C:\xampp\apache\bin\』に置く。(3)インストーラのダウンロード
再度、インストーラをダウンロードしてみると・・・
```
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar//成功
```(4)インストーラの実行
インストーラを実行してみると・・・
```
C:\Projects>php symfony.pharSymfony Installer (1.5.11)
==========================//成功
```(5)プロジェクトフォルダの作成
Symfonyのプロジェクトフォルダを作成し、Symfonyのバージョンを指定
C:\Projects>php symfony.phar new classic-symfony 3.4ここで次のエラーが出たが、これはPHP7.3を用いたアプリで表示されるらしい。
致命的なものではなく、警告らしい。
リンク:https://wordpress.org/support/topic/warning-continue-targeting-switch-is-equivalent-to-break/PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357
- 投稿日:2019-03-18T04:14:50+09:00
【エラー解決法】xamppにおけるPHP7.3を使ってSymfony3.4をインストールしたいけど、SSL-CA証明書が無い
はじめに
ProjectsというフォルダにSymfonyのインストローラをダウンロードしようとしたところ・・・
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar次のエラーが出た。
これは、『curl-ca-bundle.crt』という名のSSL-CA証明書が見つからないという意味らしい。
『C:\xampp\apache\bin』を探してみても、『curl-ca-bundle.crt』というファイルが同梱されていない・・・PHP Warning: failed loading cafile stream: `C:\xampp\apache\bin\curl-ca-bundle.crt' in Command line code on line 1 PHP Warning: readfile(): Failed to enable crypto in Command line code on line 1 PHP Warning: readfile(http://symfony.com/installer): failed to open stream: operation failed in Command line code on line 1SSL-CA証明書をcurl公式サイトからダウンロードし、フォルダに入れてみる。
リンク:https://curl.haxx.se/
(1)curl公式サイトからSSL-CA証明書をダウンロード
赤枠をクリックし、SSL-CA証明書をダウンロードする。
リンク:https://curl.haxx.se/docs/caextract.html
(2)SSL-CA証明書を指定のフォルダに置く
cacert.pemをca-bundle-curl.crtというファイル名に変更。
『C:\xampp\apache\bin\』に置く。(3)インストーラのダウンロード
再度、インストーラをダウンロードしてみると・・・
```
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar//成功
```(4)インストーラの実行
インストーラを実行してみると・・・
```
C:\Projects>php symfony.pharSymfony Installer (1.5.11)
==========================//成功
```(5)プロジェクトフォルダの作成
Symfonyのプロジェクトフォルダを作成し、Symfonyのバージョンを指定
C:\Projects>php symfony.phar new classic-symfony 3.4ここで次のエラーが出たが、これはPHP7.3を用いたアプリで表示されるらしい。
致命的なものではなく、警告らしい。
リンク:https://wordpress.org/support/topic/warning-continue-targeting-switch-is-equivalent-to-break/PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357
- 投稿日:2019-03-18T04:14:50+09:00
【エラー解決法】xamppのPHP7.3でSymfony3.4をインストールしたいけど、SSL-CA証明書が無い
はじめに
ProjectsというフォルダにSymfonyのインストローラをダウンロードしようとしたところ・・・
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar次のエラーが出た。
これは、『curl-ca-bundle.crt』という名のSSL-CA証明書が見つからないという意味らしい。
『C:\xampp\apache\bin』を探してみても、『curl-ca-bundle.crt』というファイルが同梱されていない・・・PHP Warning: failed loading cafile stream: `C:\xampp\apache\bin\curl-ca-bundle.crt' in Command line code on line 1 PHP Warning: readfile(): Failed to enable crypto in Command line code on line 1 PHP Warning: readfile(http://symfony.com/installer): failed to open stream: operation failed in Command line code on line 1SSL-CA証明書をcurl公式サイトからダウンロードし、フォルダに入れてみる。
リンク:https://curl.haxx.se/
(1)curl公式サイトからSSL-CA証明書をダウンロード
赤枠をクリックし、SSL-CA証明書をダウンロードする。
リンク:https://curl.haxx.se/docs/caextract.html
(2)SSL-CA証明書を指定のフォルダに置く
cacert.pemをca-bundle-curl.crtというファイル名に変更。
『C:\xampp\apache\bin\』に置く。(3)インストーラのダウンロード
再度、インストーラをダウンロードしてみると・・・
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar //成功(4)インストーラの実行
インストーラを実行してみると・・・
C:\Projects>php symfony.phar Symfony Installer (1.5.11) ========================== //成功(5)プロジェクトフォルダの作成
Symfonyのプロジェクトフォルダを作成し、Symfonyのバージョンを指定
C:\Projects>php symfony.phar new classic-symfony 3.4ここで次のエラーが出たが、これはPHP7.3を用いたアプリで表示されるらしい。
致命的なものではなく、警告らしい。
リンク:https://wordpress.org/support/topic/warning-continue-targeting-switch-is-equivalent-to-break/PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357
- 投稿日:2019-03-18T04:14:50+09:00
【エラー解決】xamppのPHP7.3でSymfony3.4をインストールしたいけど、SSL-CA証明書が無い
はじめに
ProjectsというフォルダにSymfonyのインストローラをダウンロードしようとしたところ・・・
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar次のエラーが出た。
これは、『curl-ca-bundle.crt』という名のSSL-CA証明書が見つからないという意味らしい。
『C:\xampp\apache\bin』を探してみても、『curl-ca-bundle.crt』というファイルが同梱されていない・・・PHP Warning: failed loading cafile stream: `C:\xampp\apache\bin\curl-ca-bundle.crt' in Command line code on line 1 PHP Warning: readfile(): Failed to enable crypto in Command line code on line 1 PHP Warning: readfile(http://symfony.com/installer): failed to open stream: operation failed in Command line code on line 1SSL-CA証明書をcurl公式サイトからダウンロードし、フォルダに入れてみる。
リンク:https://curl.haxx.se/
(1)curl公式サイトからSSL-CA証明書をダウンロード
赤枠をクリックし、SSL-CA証明書をダウンロードする。
リンク:https://curl.haxx.se/docs/caextract.html
(2)SSL-CA証明書を指定のフォルダに置く
cacert.pemをca-bundle-curl.crtというファイル名に変更。
『C:\xampp\apache\bin\』に置く。(3)インストーラのダウンロード
再度、インストーラをダウンロードしてみると・・・
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar //成功(4)インストーラの実行
インストーラを実行してみると・・・
C:\Projects>php symfony.phar Symfony Installer (1.5.11) ========================== //成功(5)プロジェクトフォルダの作成
Symfonyのプロジェクトフォルダを作成し、Symfonyのバージョンを指定
C:\Projects>php symfony.phar new classic-symfony 3.4ここで次のエラーが出たが、これはPHP7.3を用いたアプリで表示されるらしい。
致命的なものではなく、警告らしい。
リンク:https://wordpress.org/support/topic/warning-continue-targeting-switch-is-equivalent-to-break/PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357 Downloading Symfony... //成功(6)Symfonyの動作確認
symfonyのプロジェクトに移動し、実行コードを入力。
C:\Projects>cd classic-symfony C:\Projects\classic-symfony>php bin/symfony_requirements次のように出力されれば成功
Symfony Requirements Checker > PHP is using the following php.ini file: C:\xampp\php\php.ini > Checking Symfony requirements: ...........................WWW...... [OK] Your system is ready to run Symfony projects Optional recommendations to improve your setup * intl extension should be available > Install and enable the intl extension (used for validators). * a PHP accelerator should be installed > Install and/or enable a PHP accelerator (highly recommended). * realpath_cache_size should be at least 5M in php.ini > Setting "realpath_cache_size" to e.g. "5242880" or "5M" in > php.ini* may improve performance on Windows significantly in some > cases. Note The command console could use a different php.ini file ~~~~ than the one used with your web server. To be on the safe side, please check the requirements from your web server using the web/config.php script. //成功
- 投稿日:2019-03-18T04:14:50+09:00
【エラー解決】xamppのPHP7.3でSymfony3.4をインストールしたいけど、SSL-CA証明書が見当たらない
はじめに
ProjectsというフォルダにSymfonyのインストローラをダウンロードしようとしたところ・・・
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar次のエラーが出た。
これは、『curl-ca-bundle.crt』という名のSSL-CA証明書が見つからないという意味らしい。
『C:\xampp\apache\bin』を探してみても、『curl-ca-bundle.crt』というファイルが見当たらない・・・PHP Warning: failed loading cafile stream: `C:\xampp\apache\bin\curl-ca-bundle.crt' in Command line code on line 1 PHP Warning: readfile(): Failed to enable crypto in Command line code on line 1 PHP Warning: readfile(http://symfony.com/installer): failed to open stream: operation failed in Command line code on line 1SSL-CA証明書はcurl公式サイトからダウンロードできるらしいので、フォルダに入れてみる。
リンク:https://curl.haxx.se/
(1)curl公式サイトからSSL-CA証明書をダウンロード
赤枠をクリックし、SSL-CA証明書をダウンロードする。
リンク:https://curl.haxx.se/docs/caextract.html
(2)SSL-CA証明書を指定のフォルダに置く
cacert.pemをca-bundle-curl.crtというファイル名に変更。
『C:\xampp\apache\bin\』に置く。(3)インストーラのダウンロード
再度、インストーラをダウンロードしてみると・・・
C:\Projects>php -r "readfile('http://symfony.com/installer');" > symfony.phar //成功(4)インストーラの実行
インストーラを実行してみると・・・
C:\Projects>php symfony.phar Symfony Installer (1.5.11) ========================== //成功(5)プロジェクトフォルダの作成
Symfonyのプロジェクトフォルダを作成し、Symfonyのバージョンを指定
C:\Projects>php symfony.phar new classic-symfony 3.4ここで次のエラーが出たが、これはPHP7.3を用いたアプリで表示されるらしい。
致命的なものではなく、警告らしい。
リンク:https://wordpress.org/support/topic/warning-continue-targeting-switch-is-equivalent-to-break/PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 363 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php on line 382 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 197 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 216 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 254 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar://C:/Projects/symfony.phar/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 357 Downloading Symfony... //成功(6)Symfonyの動作確認
symfonyのプロジェクトに移動し、実行コードを入力。
C:\Projects>cd classic-symfony C:\Projects\classic-symfony>php bin/symfony_requirements次のように出力されれば成功
Symfony Requirements Checker > PHP is using the following php.ini file: C:\xampp\php\php.ini > Checking Symfony requirements: ...........................WWW...... [OK] Your system is ready to run Symfony projects Optional recommendations to improve your setup * intl extension should be available > Install and enable the intl extension (used for validators). * a PHP accelerator should be installed > Install and/or enable a PHP accelerator (highly recommended). * realpath_cache_size should be at least 5M in php.ini > Setting "realpath_cache_size" to e.g. "5242880" or "5M" in > php.ini* may improve performance on Windows significantly in some > cases. Note The command console could use a different php.ini file ~~~~ than the one used with your web server. To be on the safe side, please check the requirements from your web server using the web/config.php script. //成功
- 投稿日:2019-03-18T00:17:58+09:00
PHPからMySQLを利用する
1. はじめに
PHPからMySQLへ接続し,ブラウザ上にデータベースの内容を表示する.
例として,商品表を扱う.前提条件
- MAMPが起動済み(PHPとMySQLの利用が可能である)
- データベース
test
が作成済み- テーブル
shouhin
が作成済み- サーバは
localhost
とする- MySQLのユーザ名とパスワードはともに
root
とする(mampのMySQLにおけるデフォルトのもの)PHPでのエラーチェック
PHPでエラーが発生した際にブラウザ画面に表示する関数を記載しておく.
ただし,表示されないエラーもあるため注意すること.<?php ini_set('display_errors',1); ?>参考
2. 内容
2.1. データ
テーブル
shouhin
には以下のデータが登録されている.
列num
と列hinmei
はTEXT型,列kakaku
はINTEGER型である.
num hinmei kakaku 010 pc 80000 011 display 35000 020 printer 25000 025 keyboard 1000 030 mouse 3000 2.2. ソースコード
2.2.1. 先頭1行目のデータを表示
showtable.php<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <title>商品表</title> <style></style> </head> <body> <?php //MySQLのデータベースサーバへ接続(サーバ名,接続ユーザ名,パスワード,データベース名 の順に指定) $link=mysqli_connect("localhost","root","root","test"); //SQL文を指定 $query="SELECT * FROM shouhin"; //PHPからSQL文を実行(接続名 $link に対して $query のSQL文を実行) //結果は$resultに格納される $result=mysqli_query($link,$query); //$result から1行取り出して,1項目ごとに配列 $row (フィールド名をキーとした連想配列)に格納 $row=mysqli_fetch_assoc($result); //$row 配列の中身を表示 echo "番号:".$row['num']."<br>"; echo "品名:".$row['hinmei']."<br>"; echo "価格:".$row['kakaku']."<br>"; ?> </body> </html>2.2.2. 全データを表示
showtable.php<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <title>商品表</title> <style> table,th,td { border-collapse:collapse; border:1px solid black; line-height:1.5; } </style> </head> <body> <h1>商品表</h1> <?php $link=mysqli_connect("localhost","root","root","test"); $query="SELECT * FROM shouhin"; $result=mysqli_query($link,$query); echo "<table>"; echo "<tr bgcolor=#87cefa> <th>番号</th> <th>品名</th> <th>価格</th> </tr>"; while($row=mysqli_fetch_assoc($result)){ echo "<tr> <td>{$row['num']}</td> <td>{$row['hinmei']}</td> <td>{$row['kakaku']}</td> </tr>"; } echo "</table>"; ?> </body> </html>※関数は
mysql_・・・
ではなくmysqli_・・・
であることに注意
※本来はtry-catch
文で例外(MySQLへ正常に接続できなかった場合)を考慮するが,分かりやすくするためにあえて例外を考慮しない
※区別しやすくするためにあえて字下げしている.タグごとにecho
文で分けても良い.全てを1つの
echo
文にまとめた例と分けた時の例を下に示す.どちらも同じ意味を持つ.<?php echo "<div><p>あいうえお</p></div>"; ?><?php echo "<div>"; echo "<p>"; echo "あいうえお"; echo "</p>"; echo "</div>"; ?>3. おわりに
さらに,
- データ登録画面
- データ削除画面
- データ更新(編集)画面
hinmei
やkakaku
の絞り込み検索機能(表示画面に追加)などがあると便利ですね.気が向いたら記事を作成します.
プログラムは既に作成してあるんですけどね・・・.