I suspect the parameters of Amazon RDS MariaDB in the situation where the AWS environment cannot be displayed due to the following error.
If i have any knowledge about parameters that cannot be used with RDS and parameters that need to be set, would you please let me know?
The version of the DB server is different, but another server running MariaDB 10.5.5 (not an AWS environment)
Then the error does not occur and the site is displayed normally.
The Apache/OS/PHP version of the site that is displayed normally is the same as the AWS environment where the error occurs.
PHP Fatal error: Call to a member function fetchRow () on boolean in /opt/spf/htdocs/ja/usr-data/units/bSlideShow/bSlideShow.php on line 547
bSlideShow.php
).'Asc';
545 if (isset ($this->_ pageu_code)&&is_numeric ($this->_ pageu_code)) {
546 $result = $this->db->prepare ($sql, $this->_pageu_code);
547 $firstRow = $result->fetchRow (DB_FETCHMODE_ASSOC);
548 $firstRow = $this->replaceMultipleData ($firstRow, $this->column_link);
549 $rtn = $firstRow;
550 if (is_numeric ($firstRow ['umlt_code'])) {
551 $rtn ['umlt'] [] = $row = $this->setResult ($firstRow);
552 while ($row = $result->fetchRow (DB_FETCHMODE_ASSOC)) {
553 $row = $this->setResult ($row);
554 $row = $this->replaceMultipleData ($row, $this->column_link);
555 $rtn ['umlt'] [] = $row;
556}
557}
558}
559
560 return $rtn;
561}
PDO database connection test program
<? php
// PDO settings$pdo_dsn ='mysql: host = xxx-xxx-db.xxxxxx.ap-northeast-1.rds.amazonaws.com;dbname = xxx_xxxxx;charset = utf8;';
$pdo_user ='spfdb';
$pdo_pass = '4dGKqE3W';
$pdo_option = array (
PDO :: ATTR_ERRMODE =>PDO :: ERRMODE_EXCEPTION,
PDO :: ATTR_DEFAULT_FETCH_MODE =>PDO :: FETCH_ASSOC,
PDO :: ATTR_EMULATE_PREPARES =>false,
PDO :: ATTR_STRINGIFY_FETCHES =>false
);
// Database connection
try {
$pdo = new PDO ($pdo_dsn, $pdo_user, $pdo_pass, $pdo_option);
} catch (Exception $e) {
header ('Content-Type: text/plain;charset = UTF-8', true, 500);
exit ($e->getMessage ());
}
?><! DOCTYPE html><html><head><meta charset = "UTF-8"><title>PDO connection test</title></head><body><? php
// SQL issuance
$stmt = $pdo->query ("SELECT @@ version");
while ($row = $stmt->fetch ()) {
print_r ($row);
}?></body></html>
What I confirmed
-You can connect to the DB server (AmazonRDS) from the WEB server (AmazonEC2) with the mysql command.
-The PDO database connection test program can be placed and connected to the WEB server.
-PHP/PHP modules and libraries installed on the WEB server are as follows
oniguruma5php.x86_64 6.9.5 + rev1-3.el7.remi @ remi-safe
php.x86_64 5.6.40-23.el7.remi @ remi-php56
php-cli.x86_64 5.6.40-23.el7.remi @ remi-php56
php-common.x86_64 5.6.40-23.el7.remi @ remi-php56
php-devel.x86_64 5.6.40-23.el7.remi @ remi-php56
php-gd.x86_64 5.6.40-23.el7.remi @ remi-php56
php-mbstring.x86_64 5.6.40-23.el7.remi @ remi-php56
php-mcrypt.x86_64 5.6.40-23.el7.remi @ remi-php56
php-mysqlnd.x86_64 5.6.40-23.el7.remi @ remi-php56
php-opcache.x86_64 5.6.40-23.el7.remi @ remi-php56
php-pdo.x86_64 5.6.40-23.el7.remi @ remi-php56
php-pecl-jsonc.x86_64 1.3.10-2.el7.remi.5.6 @ remi-php56
php-pecl-jsonc-devel.x86_64 1.3.10-2.el7.remi.5.6 @ remi-php56
php-pecl-zip.x86_64 1.19.1-1.el7.remi.5.6 @ remi-php56
-Although the version of the DB server is different, the error does not occur on other MariaDB 10.5.5 servers, and the site is displayed normally.
Apache/OS/PHP version is the same as the site with the error
・ PHP 5.6.4
-Apache 2.4.6
・ MariaDB 10.4.13 (Amazon RDS)
・ Bingo! CMS 1.7.0a
・ CentOS 7.8
-
Answer # 1
Related articles
- error in callback function in php class
- laravel - i get the error call to a member function load () on null
- php: i want to test the connection to mysql error: fatal error: uncaught error: call to undefined function mysql_connect ()
- php fatal error "cannot redeclare" error statement
- an error occurs when calling a function in a php external file from html
- php - catchable fatal error: argument 1 passed to must be an instance of none given, i don't know the cause of the error
- php: there is an error in the insert into line and it cannot be resolved
- php - i want to implement a function to log in to a user account with an administrator account without a password
- php - page transition with comment function, cannot be sanitized
- php - the return value of the mb_send_mail function is true, but nothing arrives at the destination email address
- swift - thread 1: fatal error: index out of range
- php - [laravel] after setting up the auth function, the page that could be displayed until now can no longer be displayed
- php - call to undefined function mb_language () when changing the theme in wordpress
- php parse error: syntax error, unexpected'class' (t_class) error
- i want to use a user-defined function that contains magic constants in php
- i want to solve a php function problem! !!
- error occurred in postgresql trigger function and stored procedure
- php - i want to implement an editing function i would like advice
- python - i want to learn using my own error function in tensorflow
- i want to create a function that passes php int type and string type and outputs the content string of the int type number of ti
- php : Can't figure out what's wrong with MySQL database
- PHP code opens instead of the site
- How to combine php and java servers?
- php : Redirecting from the page address to the get parameter of the request
- php : openserver won't start with any version of mysql
- php : Error sending messages over SMTP in Laravel
- XAMPP. Called the GMP library in VS Code for PHP language on Windows. The answer is taken out, not a number, but as a variable.
- XAMPP, VS Code, PHP, Windows. Parse error: syntax error, unexpected identifier "Chislo", expecting "," or ";" on line 5
- php : Laravel not displaying images on third party resource
Call to a member function fetchRow () on boolean
SoHere
$result
Tofalse false
It seems that is included.See the return value section of PDO :: prepare
The connection test code is designed to catch exceptions, but I feel that it is not included in production.
It's difficult to find the cause, so
If you're debugging yourself (if you don't have any proof that you haven't squeezed the exception elsewhere)
Check if the exception is thrown as.