php - 无法在kali linux上配置LAMP

标签 php mysql linux apache sockets

大家好,我又来了,我在配置 LAMP 时遇到了一些问题

首先,我已经安装了所有内容,但我无法运行 test.php 来查看 php 是否根据 ifconfig 命令工作,我的地址是:192.168.1.77 所以在浏览器中当我尝试运行 192.168.1.77/test.php 时,没有任何反应。我按照本视频中的说明进行操作。 How to set up a Debian LAMP Server

其次,当我尝试更改 mysql 上的密码时,我收到此错误,因为我无法执行与 mysql 有关的任何操作。当我运行此命令时 apache2 -v && mysql -v && php -v 我收到此错误。

Server version: Apache/2.2.22 (Debian) Server built: Feb 1 2014 21:26:04 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

当我尝试运行此命令/usr/bin/mysqladmin -u root password 'mypassword'时,我收到此错误。

/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

我按照本指南访问 LAMP, Linux Apache MySQL PHP但由于我的 mysql 存在这些问题,我无法完成正确的配置。非常感谢您的任何帮助或评论,祝您有美好的一天。

最佳答案

快速搜索也许能为您指明正确的方向,您安装了这个吗?

apt-get install mysql-server

它似乎在提示 mysqld,它是 mysql-server 程序,也许也可以尝试这个:

mysql服务启动

你会看到这个:

[ ok ] Starting MySQL database server: mysqld ..
[info] Checking for tables which need an upgrade, are corrupt or were 
not closed cleanly..

注意它是如何说 mysqld

如果这不起作用,请尝试这个:

apt-get install --reinstall mysql-server

希望这对您有所帮助

关于php - 无法在kali linux上配置LAMP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21910877/

相关文章:

linux - 在具有 x64 操作系统 (redhat 5.6) 的 x64 CPU (Xeon 7650) 上运行的 X64 应用程序的 2GB 障碍 - 为什么 + 要检查的内容

linux - 纪元时间/时间戳 wireshark vs perf trace

php - 如何在html复选框中加载mysql数据

java - 从以编程方式定义的结构填充 javaFX TableView 的最佳方法

php - 使用.htaccess,阻止用户访问资源目录,但允许源代码访问资源

mysql - 连接表将行列为连接到另一个表的列?

mysql - 加入子查询,反模式?

linux - 有哪些解决方案可以有效备份网络服务器上数百万个图像文件和子目录?

php - Mysql sql 行到列

javascript - 从 Mysql 中选择日期以与 bootstrap datepicker 一起使用