操作系统 Linux Mint 到 VirtualBox
我已经按照本手册安装了 PHP, https://community.linuxmint.com/tutorial/view/486
当我尝试测试 PHP 并转到http://localhost/testphp.php 它给了我这个,“请求的 URL /testphp.php 在该服务器上没有找到。”但是我有它,
danko-VirtualBox www # pwd
/var/www
danko-VirtualBox www # ls
html testphp.php
danko-VirtualBox www # cat < testphp.php
<?php phpinfo(); ?>
并且 Apache 正在运行。
一些先前的步骤
danko-VirtualBox danko # killall nginx
danko-VirtualBox danko # netstat -punta | grep LISTEN
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 597/smbd
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 1246/dnsmasq
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1835/cupsd
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 597/smbd
tcp6 0 0 :::139 :::* LISTEN 597/smbd
tcp6 0 0 ::1:631 :::* LISTEN 1835/cupsd
tcp6 0 0 :::445 :::* LISTEN 597/smbd
danko-VirtualBox danko # sudo apt-get install php5 libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-php5 is already the newest version.
php5 is already the newest version.
The following packages were automatically installed and are no longer required:
kate-data katepart kde-runtime kde-runtime-data kdegames-card-data
kdelibs-bin kdelibs5-data kdelibs5-plugins kdoctools
language-selector-common libattica0.4 libdlrestrictions1 libgcrypt20
libkactivities6 libkatepartinterfaces4 libkcmutils4 libkde3support4
libkdeclarative5 libkdecore5 libkdegames6abi1 libkdesu5 libkdeui5
libkdewebkit5 libkdnssd4 libkemoticons4 libkfile4 libkhtml5 libkio5
libkjsapi4 libkjsembed4 libkmediaplayer4 libknewstuff3-4 libknotifyconfig4
libkntlm4 libkparts4 libkpty4 libkrosscore4 libktexteditor4 libkubuntu0
libkxmlrpcclient4 libntrack-qt4-1 libntrack0 libphonon4 libplasma3
libpolkit-qt-1-1 libqapt2 libqapt2-runtime libqca2 libqt4-qt3support
libqtmultimediakit1 libsolid4 libssh-4 libstreamanalyzer0 libstreams0
libthreadweaver4 libutempter0 ntrack-module-libnl-0 oxygen-icon-theme phonon
phonon-backend-gstreamer phonon-backend-gstreamer-common
phonon-backend-gstreamer1.0 plasma-scriptengine-javascript
qtdeclarative4-kqtquickcharts-1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 315 not upgraded.
danko-VirtualBox danko # sudo /etc/init.d/apache2 restart
Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1.
Set the 'ServerName' directive globally to suppress this message
[ OK ]
答案1
我使用以下命令重新安装 PHP 后它开始工作:
sudo apt-get install php5-cli