Score:0

phpinfo not showing mysql, pages that require mysql connection is giving HTTP 500

mx flag

I am running php 5.4.16 on a rhel 7.9 webserver (httpd 2.4.6). When doing phpinfo(), there is no mysql section.

Php pages that require a connection to the mysql database are giving error 500. Example page is a simple attempt at connection, it is giving HTTP 500.

<?php require_once('../Connections/connMySQL.php'); ?>
<html>
<body>
<h1>Hello World</h1>
</body>
</html>

The server has the following mysql packages installed: yum list | grep mysql

mysql-community-client.x86_64        5.7.41-1.el7                  
mysql-community-common.x86_64        5.7.41-1.el7                  
mysql-community-libs.x86_64          5.7.41-1.el7                  
mysql-community-libs-compat.x86_64   5.7.41-1.el7                  
mysql-community-server.x86_64        5.7.41-1.el7                  

When using php -m, it gives me a list of modules:

[PHP Modules]
bz2
calendar
Core
ctype
curl
date
ereg
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
json
libxml
mhash
openssl
pcntl
pcre
Phar
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
tokenizer
xml
zip
zlib

[Zend Modules]

The mysql daemon is also running

systemctl status mysqld.service
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2023-02-15 09:51:13 MST; 3h 3min ago

I also have enabled display_errors = On in php.ini

Its giving the following error:

Call to undefined function mysql_pconnect() in /var/www/html/...

Does the above means mysql is not configured on the server? How should I go about in configuring php if yes?

Score:0
ar flag

Install the php-mysql package and enable it.

You should probably not be running a web server you don't have a basic understanding of.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.