doushi3454 2017-04-04 00:25
浏览 58

PHP错误未定义函数crypt_random_string与phpmyadmin,apache2,php5.3

I have phpMyAdmin running on my server, and am able to connect to the setup page. However, when I went to add a server, it appeared to save but now loading the overview page shows nothing, and error.log has the below:

[Tue Apr 04 00:15:16 2017] [error] [client OMITTED] PHP Fatal error:  Call to undefined function crypt_random_string() in /usr/share/phpMyAdmin/setup/lib/index.lib.php on line 333, referer: https://OMITTED/phpmyadmin/setup/index.php

I believe this happened when it tried to save the server authentication password, but for the life of me I cant figure out what I have to install. Im running centos6.8, apache 2.2.15, php 5.3.3 and yum told me phpMyAdmin was 4.0

EDIT: my session path is /var/lib/php/session, and has the below permission (and session file):

[root@host php]# ls -ltr session/
total 8
-rw------- 1 apache apache 8021 Apr  4 00:15 sess_10h5if6dcctfhucej78678322lkhohlh
[root@host php]# ls -ltr
total 4
drwxrwx--- 2 root apache 4096 Apr  4 00:00 session
[root@host php]#pwd
/var/lib/php

I also read through the comment about the referenced paths, but its not 100% helpful as I dont know the library that contains this function, so I'm not sure what file im trying to locate. /usr/share/phpMyAdmin is the virtual host document root, and /usr/share/phpMyAdmin/setup/lib/index.lib.php is in that absolute path, and is the script that raised the error. I can't see where its supposed to load this function however

EDIT2: Read some more on the referenced question, and I do have mbstring installed:

[root@host php]# yum list installed | grep php
php.x86_64                         5.3.3-48.el6_8              @updates
php-bcmath.x86_64                  5.3.3-48.el6_8              @updates
php-cli.x86_64                     5.3.3-48.el6_8              @updates
php-common.x86_64                  5.3.3-48.el6_8              @updates
php-gd.x86_64                      5.3.3-48.el6_8              @updates
php-mbstring.x86_64                5.3.3-48.el6_8              @updates
php-mcrypt.x86_64                  5.3.3-4.el6                 @epel
php-mysql.x86_64                   5.3.3-48.el6_8              @updates
php-pdo.x86_64                     5.3.3-48.el6_8              @updates
php-php-gettext.noarch             1.0.11-12.el6               @epel
php-process.x86_64                 5.3.3-48.el6_8              @updates
php-tcpdf.noarch                   6.2.11-1.el6                @epel
php-tcpdf-dejavu-sans-fonts.noarch 6.2.11-1.el6                @epel
php-tidy.x86_64                    5.3.3-48.el6_8              @updates
php-xml.x86_64                     5.3.3-48.el6_8              @updates
phpMyAdmin.noarch                  4.0.10.17-2.el6             @epel
  • 写回答

1条回答 默认 最新

  • douruye5092 2017-04-04 18:24
    关注

    So I did some more digging in the require lines, and everything was looking correct. I then deleted my session in /var/lip/php/sessions and was able to load the overview page on /setup. I recreated the server, this time with HTTP authentication instead of cookie (as line 333 in the index.php file is only run if a server is configured with cookie config) and it worked!

    I did have to change /usr/share/phpMyAdmin/setup/config.php line 15

    from

    require_once './lib/ConfigGenerator.class.php';
    

    to

    require_once './setup/lib/ConfigGenerator.class.php';
    

    to properly download the config file, but once I got that and placed in /etc/phpMyAdmin, server prompted for login, and I was able to connect. Doesn't really solve the issue of the missing function, but solved enough for my use case

    评论

报告相同问题?

悬赏问题

  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区
  • ¥20 jupyter保存图像功能的实现
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示
  • ¥15 NAO机器人的录音程序保存问题
  • ¥15 C#读写EXCEL文件,不同编译
  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符