YouTube-operational-API
YouTube-operational-API copied to clipboard
Get Docker errors
Would help https://matrix.to/#/!xUzcWVLNMgGmLGBdRL:matrix.org/$UzmAQOtYWNzuKpWbe19VCbbZwW7j9Olrp-UX8S4LP04.
test.php:
test.php
<?php
echo 'test'
php test.php
PHP Parse error: syntax error, unexpected end of file, expecting "," or ";" in /var/www/html/YouTube-operational-API/test.php on line 4
curl 'http://localhost:8080/test.php'
Output:
<br />
<b>Parse error</b>: syntax error, unexpected end of file, expecting "," or ";" in <b>/var/www/html/test.php</b> on line <b>4</b><br />
api_1 | 172.18.0.1 - - [28/Oct/2024:15:40:02 +0000] "GET /test.php HTTP/1.1" 200 361 "-" "curl/7.88.1"
include_once 'common.php';
does not change anything. Maybe it is because a parsing error and not a runtime error.
Adding after include_once 'common.php';:
include_once 'not_existing.php';
curl 'http://localhost:8080/test.php'
test
If remove include_once 'common.php';, then have:
curl 'http://localhost:8080/test.php'
Output:
<br />
<b>Warning</b>: include_once(not_existing.php): Failed to open stream: No such file or directory in <b>/var/www/html/test.php</b> on line <b>5</b><br />
<br />
<b>Warning</b>: include_once(): Failed opening 'not_existing.php' for inclusion (include_path='.:/usr/local/lib/php') in <b>/var/www/html/test.php</b> on line <b>5</b><br />
test
In last both cases have:
curl -I 'http://localhost:8080/test.php'
Output:
HTTP/1.1 200 OK
Date: Mon, 28 Oct 2024 20:58:42 GMT
Server: Apache/2.4.62 (Debian)
X-Powered-By: PHP/8.3.13
Content-Type: text/html; charset=UTF-8
api_1 | 172.18.0.1 - - [28/Oct/2024:20:58:42 +0000] "HEAD /test.php HTTP/1.1" 200 154 "-" "curl/7.88.1"