vagrant box remove vje/min
, vagrant destroy
, vagrant up
which will force it to recreate everything from scratch and it's working fine (though I'm on Linux, it shouldn't make any difference in a VM). Where are you seeing the PID message? systemctl status nginx
?
I followed the sequence of the commands indicated ... "vagrant box remove vje / min, vagrant destroy, vagrant up" but the browser does not connect to the server ...
then i ran: sudo systemctl status nginx ...
this is the message on the terminal:
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-12-29 19:27:52 GMT; 2min 53s ago
Process: 1045 ExecReload = / usr / bin / nginx -s reload (code = exited, status = 0 / SUCCESS)
Main PID: 409 (nginx)
Tasks: 2 (limit: 515)
Memory: 5.5M
CGroup: /system.slice/nginx.service
├─ 409 nginx: master process / usr / bin / nginx -g pid /run/nginx.pid; error_log stderr;
└─1046 nginx: worker process
Dec 29 19:27:47 v.je systemd [1]: Starting A high performance web server and a reverse proxy server ...
Dec 29 19:27:52 v.je systemd [1]: nginx.service: Can't open PID file /run/nginx.pid (yet?) After start: No such file or directory
Dec 29 19:27:52 v.je systemd [1]: Started A high performance web server and a reverse proxy server.
Dec 29 19:28:02 v.je systemd [1]: Reloading A high performance web server and a reverse proxy server.
Dec 29 19:28:03 v.je nginx [1045]: 2021/12/29 19:28:03 [notice] 1045 # 1045: signal process started
Dec 29 19:28:03 v.je systemd [1]: Reloaded A high performance web server and a reverse proxy server.
then I found these instructions on the internet ... the first one ... "curl -I -v http://127.0.0.1/"
terminal message:
HEAD / HTTP / 1.1
Host: 127.0.0.1
User-Agent: curl / 7.62.0
Accept: /<HTTP / 1.1 301 Moved Permanently
HTTP / 1.1 301 Moved Permanently
<Server: nginx / 1.15.6
Server: nginx / 1.15.6
<Date: Wed, 29 Dec 2021 19:34:45 GMT
Dates: Wed, 29 Dec 2021 19:34:45 GMT
<Content-Type: text / html
Content-Type: text / html
<Content-Length: 169
Content-Length: 169
<Connection: keep-alive
Connection: keep-alive
<Location: https://v.je/
Location: https://v.je/
<
from which, it seems to me, that it manages to establish a connection (even if from the browser the connection error occurs both with "127.0.0.1", and with "v.je", and with "localhost" ...
then the following statement ... "curl -I -v http: // localhost /"
terminal message:
HEAD / HTTP / 1.1
Host: localhost
User-Agent: curl / 7.62.0
Accept: /<HTTP / 1.1 301 Moved Permanently
HTTP / 1.1 301 Moved Permanently
<Server: nginx / 1.15.6
Server: nginx / 1.15.6
<Date: Wed, 29 Dec 2021 19:38:50 GMT
Dates: Wed, 29 Dec 2021 19:38:50 GMT
<Content-Type: text / html
Content-Type: text / html
<Content-Length: 169
Content-Length: 169
<Connection: keep-alive
Connection: keep-alive
<Location: https://v.je/
Location: https://v.je/
<
and here the first problem already appears
then the third statement ... "curl -I -v http: // serverhostname /"
terminal message:
finally the fourth instruction ... "nslookup localhost"
terminal message:
-bash: nslookup: command not found
this is what I found ... so it seems that there is a problem ... but what caused it, I don't understand it ... since at the date of December 16th (i.e. when I posted the previous messages) I was doing the tests on all 2 configurations (Vagrant and Docker) and since that date "nothing strange happened"
i think i will try to format the disk and start from scratch ...
thanks for your help, it's not easy to find such helpful people
p.s .: sorry for the length of the post ... it's just to make the "picture" clearer
I made the change:
#
#
192.168.56.2 localhost.localdomain localhost
:: 1 localhost.localdomain localhost
192.168.56.2 v.je localhost
no changes ... I stopped the virtual machine (vagrant halt) and restarted (vagrant up) ... checked that the changes to the file were still present ... but from the browser the server is not reachable ... I noticed, restarting the virtual machine, that the "mapped" address is still 127.0.0.1 ... here is a part of the startup screen:
...
==> default: Forwarding ports ...
default: 80 (guest) => 8080 (host) (adapter 1)
default: 80 (guest) => 80 (host) (adapter 1)
default: 3306 (guest) => 3307 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations ...
==> default: Booting VM ...
==> default: Waiting for machine to boot. This may take a few minutes ...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
...
maybe because to access the server I use the following instruction?
ssh vagrant@127.0.0.1 -p 2222
To use the MySQL client I found this command online:
docker exec -it sites_mysql_1 /bin/bash
mysql -u v.je -p
or
docker exec -it sites_mysql_1 mysql -u v.je -p
The second thing is that I noticed that the same code works without problems with PHP7 (vagrant version) while Warnings appear with PHP8 (Docker version), in particular:
"WARNING: Undefined Array Key" ID _..." in /…../DbTable.php online 245"
these are the rows of the "save ()" method (the 245 is the first after the try instruction):
Try {
If ($record [$this-> primaryKey] == '') {
$record [$this-> primaryKey] = null;
}
"Warning: Cannot modify header information - headers already sent by (output started at /…../DbTable.php:245) in /…../Register.php on line 88"
this is the line 88 of the "RegisterUser()" method:
header (‘location: /participanti/success);
"Warning: trying to access array offset on value of type null in /...../EntryPoint.php on line 50" and the same "error" on line 55
this is the line 50 of the "Run ()" method:
$title = $page[‘title'];
and 55:
$output = $this-> loadTemplate($page[‘template']);
"Warning: include(/...../ templates): Failed to open stream: No error information in /…../EntryPoint.php on line 28"
"WARNING: includes(): Failed opening '/...../templates/' for inclusion (include_path='.: /usr/local/lib/php') in /…../EntryPoint.php on line 28 "
this is the line 28 of the “loadTemplate()" method:
include DIR. '/../../templates/'. $templateFileName;
This happens when I insert a new user