PHPの参考書で勉強しています。
「Chapter 5 画像管理プログラムをつくってみよう」に来ています。
URL https://localhost\これからはじめる人のPHP学習帖\Chapter5
は実行できるのですが、
https://localhost\これからはじめる人のPHP学習帖\Chapter5\img_db
を実行すると「サーバーに接続できません!」という表示が出ます。
https://localhost\これからはじめる人のPHP学習帖\Chapter4\4-4\18.php
は正常に実行することができます。
エラー内容を見てもよくわからないのでどこが悪いのか教えてください。
欠けている情報がありましたらお知らせください。
お願いいたします。
<?php // --------------------------------------- // データベースの環境変数 // --------------------------------------- $usr = 'root'; // ユーザー名(USBWebserverの場合) $pwd = 'usbw'; // パスワード(USBWebserverの場合) $host = 'localhost'; // データベース・ホスト名 $dbName = 'test'; // データベース名 $tblName = 'gallery'; // テーブル名 // --------------------------------------- // 画像管理プログラム用のテーブル定義 // --------------------------------------- $tableDef = array( 'title' => 'VARCHAR(20)', // タイトル 'name' => 'VARCHAR(50)', // 元のファイル名 'size' => 'INT', // ファイルサイズ 'height' => 'INT', // 高さ 'width' => 'INT', // 幅 'word' => 'VARCHAR(50)', // キーワード 'radio' => 'INT', // ラジオボタン 'checkbox' => 'VARCHAR(20)', // チェックボックス 'date' => 'DATETIME', // 登録日時 'image' => 'MEDIUMBLOB' // 画像ファイル ); /* 実行結果 http://localhost/C:\xampp\htdocs\これからはじめる人のPHP学習帖 \Chapter5a\img-db/createThum.php で以下が表示される。 */ ?> コード
mysql_error.log
1....後半 22021-01-09 14:49:14 0 [Note] C:\xampp\mysql\bin\mysqld.exe (initiated by: unknown): Normal shutdown 32021-01-09 14:49:14 0 [Note] Event Scheduler: Purging the queue. 0 events 42021-01-09 14:49:14 0 [Note] InnoDB: FTS optimize thread exiting. 52021-01-09 14:49:14 0 [Note] InnoDB: Starting shutdown... 62021-01-09 14:49:14 0 [Note] InnoDB: Dumping buffer pool(s) to C:\XAMPP\mysql\data\ib_buffer_pool 72021-01-09 14:49:14 0 [Note] InnoDB: Instance 0, restricted to 250 pages due to innodb_buf_pool_dump_pct=25 82021-01-09 14:49:14 0 [Note] InnoDB: Buffer pool(s) dump completed at 210109 14:49:14 92021-01-09 14:49:15 0 [Note] InnoDB: Shutdown completed; log sequence number 1049358; transaction id 2589 102021-01-09 14:49:15 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" 112021-01-09 14:49:15 0 [Note] C:\xampp\mysql\bin\mysqld.exe: Shutdown complete 12 13InnoDB: using atomic writes. 142021-01-09 14:49:20 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 152021-01-09 14:49:20 0 [Note] InnoDB: Uses event mutexes 162021-01-09 14:49:20 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 172021-01-09 14:49:20 0 [Note] InnoDB: Number of pools: 1 182021-01-09 14:49:20 0 [Note] InnoDB: Using SSE2 crc32 instructions 192021-01-09 14:49:20 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M 202021-01-09 14:49:20 0 [Note] InnoDB: Completed initialization of buffer pool 212021-01-09 14:49:20 0 [Note] InnoDB: 128 out of 128 rollback segments are active. 222021-01-09 14:49:20 0 [Note] InnoDB: Creating shared tablespace for temporary tables 232021-01-09 14:49:20 0 [Note] InnoDB: Setting file 'C:\XAMPP\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 242021-01-09 14:49:20 0 [Note] InnoDB: File 'C:\XAMPP\mysql\data\ibtmp1' size is now 12 MB. 252021-01-09 14:49:20 0 [Note] InnoDB: Waiting for purge to start 262021-01-09 14:49:20 0 [Note] InnoDB: 10.4.17 started; log sequence number 1049358; transaction id 2587 272021-01-09 14:49:20 0 [Note] InnoDB: Loading buffer pool(s) from C:\XAMPP\mysql\data\ib_buffer_pool 282021-01-09 14:49:20 0 [Note] Plugin 'FEEDBACK' is disabled. 292021-01-09 14:49:20 0 [Note] Server socket created on IP: '::'. 302021-01-09 14:49:20 0 [Note] Reading of all Master_info entries succeeded 312021-01-09 14:49:20 0 [Note] Added new Master_info '' to hash table 322021-01-09 14:49:20 0 [Note] C:\xampp\mysql\bin\mysqld.exe: ready for connections. 33Version: '10.4.17-MariaDB' socket: '' port: 3306 mariadb.org binary distribution 342021-01-09 14:49:20 0 [Note] InnoDB: Buffer pool(s) load completed at 210109 14:49:20 352021-01-09 14:49:58 8 [Warning] Access denied for user 'root'@'localhost' (using password: YES) 362021-01-09 14:50:01 9 [Warning] Access denied for user 'root'@'localhost' (using password: YES) 372021-01-09 14:53:42 12 [Warning] Access denied for user 'root'@'localhost' (using password: YES) 382021-01-09 15:07:39 13 [Warning] Access denied for user 'root'@'localhost' (using password: YES) 392021-01-09 15:07:43 14 [Warning] Access denied for user 'root'@'localhost' (using password: YES) 402021-01-09 15:26:23 16 [Warning] Access denied for user 'root'@'localhost' (using password: YES) 412021-01-09 15:33:27 17 [Warning] Access denied for user 'root'@'localhost' (using password: YES) 422021-01-09 15:54:37 19 [Warning] Access denied for user 'root'@'localhost' (using password: YES) 432021-01-09 16:10:32 20 [Warning] Access denied for user 'root'@'localhost' (using password: YES) 44
Apache error.log
1[Sat Jan 09 13:50:05.161264 2021] [php:error] [pid 7460:tid 1800] [client 127.0.0.1:52003] script 'C:/XAMPP/htdocs/\xe3\x81\x93\xe3\x82\x8c\xe3\x81\x8b\xe3\x82\x89\xe3\x81\xaf\xe3\x81\x98\xe3\x82\x81\xe3\x82\x8b\xe4\xba\xba\xe3\x81\xaePHP\xe5\xad\xa6\xe7\xbf\x92\xe5\xb8\x96/Chapter4/4-4/regist.php' not found or unable to stat 2[Sat Jan 09 13:51:31.020492 2021] [php:warn] [pid 7460:tid 1800] [client 127.0.0.1:52033] PHP Warning: require_once(env.php): Failed to open stream: No such file or directory in C:\XAMPP\htdocs\\xe3\x81\x93\xe3\x82\x8c\xe3\x81\x8b\xe3\x82\x89\xe3\x81\xaf\xe3\x81\x98\xe3\x82\x81\xe3\x82\x8b\xe4\xba\xba\xe3\x81\xaePHP\xe5\xad\xa6\xe7\xbf\x92\xe5\xb8\x96\Chapter4\4-6\regist.php on line 12 3[Sat Jan 09 13:51:31.020492 2021] [php:error] [pid 7460:tid 1800] [client 127.0.0.1:52033] PHP Fatal error: Uncaught Error: Failed opening required 'env.php' (include_path='C:\XAMPP\php\PEAR') in C:\XAMPP\htdocs\\xe3\x81\x93\xe3\x82\x8c\xe3\x81\x8b\xe3\x82\x89\xe3\x81\xaf\xe3\x81\x98\xe3\x82\x81\xe3\x82\x8b\xe4\xba\xba\xe3\x81\xaePHP\xe5\xad\xa6\xe7\xbf\x92\xe5\xb8\x96\Chapter4\4-6\regist.php:12\nStack trace:\n#0 {main}\n thrown in C:\XAMPP\htdocs\\xe3\x81\x93\xe3\x82\x8c\xe3\x81\x8b\xe3\x82\x89\xe3\x81\xaf\xe3\x81\x98\xe3\x82\x81\xe3\x82\x8b\xe4\xba\xba\xe3\x81\xaePHP\xe5\xad\xa6\xe7\xbf\x92\xe5\xb8\x96\Chapter4\4-6\regist.php on line 12 4[Sat Jan 09 14:24:35.959450 2021] [php:warn] [pid 7460:tid 1808] [client 127.0.0.1:53012] PHP Warning: Undefined variable $p in C:\XAMPP\htdocs\img_db\head.html on line 4 5[Sat Jan 09 14:24:35.959450 2021] [php:warn] [pid 7460:tid 1808] [client 127.0.0.1:53012] PHP Warning: Attempt to read property "title" on null in C:\XAMPP\htdocs\img_db\head.html on line 4 6[Sat Jan 09 14:24:35.959450 2021] [php:warn] [pid 7460:tid 1808] [client 127.0.0.1:53012] PHP Warning: Undefined variable $db in C:\XAMPP\htdocs\img_db\head.html on line 12 7[Sat Jan 09 14:24:35.959450 2021] [php:warn] [pid 7460:tid 1808] [client 127.0.0.1:53012] PHP Warning: Attempt to read property "error" on null in C:\XAMPP\htdocs\img_db\head.html on line 12 8[Sat Jan 09 14:24:35.959450 2021] [php:warn] [pid 7460:tid 1808] [client 127.0.0.1:53012] PHP Warning: Undefined variable $p in C:\XAMPP\htdocs\img_db\head.html on line 21 9[Sat Jan 09 14:24:35.959450 2021] [php:warn] [pid 7460:tid 1808] [client 127.0.0.1:53012] PHP Warning: Attempt to read property "menu" on null in C:\XAMPP\htdocs\img_db\head.html on line 21 10[Sat Jan 09 14:24:35.959450 2021] [php:warn] [pid 7460:tid 1808] [client 127.0.0.1:53012] PHP Warning: Undefined variable $p in C:\XAMPP\htdocs\img_db\head.html on line 24 11[Sat Jan 09 14:24:35.959450 2021] [php:warn] [pid 7460:tid 1808] [client 127.0.0.1:53012] PHP Warning: Attempt to read property "title" on null in C:\XAMPP\htdocs\img_db\head.html on line 24 12[Sat Jan 09 14:49:11.808822 2021] [mpm_winnt:notice] [pid 948:tid 616] AH00422: Parent: Received shutdown signal -- Shutting down the server. 13[Sat Jan 09 14:49:13.830949 2021] [mpm_winnt:notice] [pid 7460:tid 560] AH00364: Child: All worker threads have exited. 14[Sat Jan 09 14:49:15.277392 2021] [mpm_winnt:notice] [pid 948:tid 616] AH00430: Parent: Child process 7460 exited successfully. 15[Sat Jan 09 14:49:18.302853 2021] [ssl:warn] [pid 4304:tid 624] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name 16[Sat Jan 09 14:49:18.349862 2021] [ssl:warn] [pid 4304:tid 624] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name 17[Sat Jan 09 14:49:18.369859 2021] [mpm_winnt:notice] [pid 4304:tid 624] AH00455: Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/8.0.0 configured -- resuming normal operations 18[Sat Jan 09 14:49:18.369859 2021] [mpm_winnt:notice] [pid 4304:tid 624] AH00456: Apache Lounge VS16 Server built: Oct 2 2020 11:45:39 19[Sat Jan 09 14:49:18.369859 2021] [core:notice] [pid 4304:tid 624] AH00094: Command line: 'C:\xampp\apache\bin\httpd.exe -d C:/XAMPP/apache' 20[Sat Jan 09 14:49:18.369859 2021] [mpm_winnt:notice] [pid 4304:tid 624] AH00418: Parent: Created child process 1828 21[Sat Jan 09 14:49:18.770275 2021] [ssl:warn] [pid 1828:tid 556] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name 22[Sat Jan 09 14:49:18.810276 2021] [ssl:warn] [pid 1828:tid 556] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name 23[Sat Jan 09 14:49:18.834446 2021] [mpm_winnt:notice] [pid 1828:tid 556] AH00354: Child: Starting 150 worker threads. 24[Sat Jan 09 15:38:00.741635 2021] [php:error] [pid 1828:tid 1816] [client 127.0.0.1:54915] script 'C:/XAMPP/htdocs/\xe3\x81\x93\xe3\x82\x8c\xe3\x81\x8b\xe3\x82\x89\xe3\x81\xaf\xe3\x81\x98\xe3\x82\x81\xe3\x82\x8b\xe4\xba\xba\xe3\x81\xaePHP\xe5\xad\xa6\xe7\xbf\x92\xe5\xb8\x96/Chapter4/4-6/19.php' not found or unable to stat 25
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2021/01/10 01:11
2021/01/10 02:02
退会済みユーザー
2021/01/17 05:15
2021/01/17 07:10