安装了 php5-mysql 这个扩展后,还是找不到文件:cat: /etc/php5/conf.d/mysql.ini: No such file or directory

来源:4-1 使用apt-get工具安装Apache PHP MySQL

iGreenMind

2015-06-30 17:16

igreenmind@iGreenMind:~$ sudo apt-get install php5-mysql

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following NEW packages will be installed:

  php5-mysql

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

Need to get 63.2 kB of archives.

After this operation, 297 kB of additional disk space will be used.

Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main php5-mysql amd64 5.5.9+dfsg-1ubuntu4.9 [63.2 kB]

Fetched 63.2 kB in 3s (19.3 kB/s)     

Selecting previously unselected package php5-mysql.

(Reading database ... 83495 files and directories currently installed.)

Preparing to unpack .../php5-mysql_5.5.9+dfsg-1ubuntu4.9_amd64.deb ...

Unpacking php5-mysql (5.5.9+dfsg-1ubuntu4.9) ...

Processing triggers for libapache2-mod-php5 (5.5.9+dfsg-1ubuntu4.9) ...

Setting up php5-mysql (5.5.9+dfsg-1ubuntu4.9) ...


Creating config file /etc/php5/mods-available/mysql.ini with new version

php5_invoke: Enable module mysql for cli SAPI

php5_invoke: Enable module mysql for apache2 SAPI


Creating config file /etc/php5/mods-available/mysqli.ini with new version

php5_invoke: Enable module mysqli for cli SAPI

php5_invoke: Enable module mysqli for apache2 SAPI


Creating config file /etc/php5/mods-available/pdo_mysql.ini with new version

php5_invoke: Enable module pdo_mysql for cli SAPI

php5_invoke: Enable module pdo_mysql for apache2 SAPI

Processing triggers for libapache2-mod-php5 (5.5.9+dfsg-1ubuntu4.9) ...

igreenmind@iGreenMind:~$ cat /etc/php5/conf.d/mysql.ini

cat: /etc/php5/conf.d/mysql.ini: No such file or directory

igreenmind@iGreenMind:~$ sudo service mysql restart

mysql stop/waiting

mysql start/running, process 4527

igreenmind@iGreenMind:~$ cat /etc/php5/conf.d/mysql.ini

cat: /etc/php5/conf.d/mysql.ini: No such file or directory

igreenmind@iGreenMind:~$ sudo service 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 ]

igreenmind@iGreenMind:~$ cat /etc/php5/conf.d/mysql.ini

cat: /etc/php5/conf.d/mysql.ini: No such file or directory

igreenmind@iGreenMind:~$ 


写回答 关注

17回答

  • carol_PHP
    2020-06-17 11:58:49

    同样的问题o(TヘTo)

  • 1_铭
    2016-09-17 21:25:59

    Ubuntu14.04版本对应的目录查看方法:cat /etc/php5/mods-available/mysql.ini即可查看.

  • James_Cole
    2016-08-04 01:08:47

    视频中讲解是Ubuntu12版本,Ubuntu14.04版本对应的目录查看方法:cat /etc/php5/mods-available/mysql.ini即可查看.

  • lmh123
    2016-07-25 10:41:35

    你们的ubuntu版本是什么,我试过12.10就可以成功,14.10就不行了

  • 繁华如梦倾城殇
    2016-07-18 21:57:02

    同样问题


  • 慕容5501556
    2016-05-09 23:57:55

    求解答


  • 髢篭
    2016-05-05 21:28:27

    求解。。

  • 白露sonia
    2016-04-26 19:36:19

    同样的问题。。。

  • Trouble_to_trouble
    2016-04-18 22:15:35

    同样的问题、、、

  • 慕粉8452047
    2016-02-05 20:24:37

    同样的问题

  • 无畏前行
    2016-02-03 20:44:52

    同样的问题

  • 乖乖01234
    2016-02-02 15:52:41

    我也是这个问题

  • JiaZombie
    2015-11-03 19:59:42

     cat /etc/php5/mods-available/mysql.ini即可查看

  • realJason
    2015-10-06 23:18:41

    我也是这个问题,求解

  • 田心枫
    2015-09-25 11:07:35

    确实存在这种问题 

  • 小灰灰heart
    2015-09-11 20:31:49

    我也出现了这种问题,不知道是什么情况

  • 獵遍天下
    2015-07-03 21:07:30

    你有装mysql么

    狐尼克 回复iGreen...

    我也出现了这种问题,你最后解决了吗

    2015-07-26 19:07:05

    共 2 条回复 >

在Ubuntu Server下搭建LAMP环境

想学PHP要会搭建LAMP环境,本教程为你学习PHP铺平道路

41158 学习 · 391 问题

查看课程

相似问题