PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.6
Webmin version 2.105
Usermin version 2.005
Virtualmin version 7.8.2 Pro
Theme version 21.09.5
Package updates Tous les packages installés sont à jour

hello friends please anyone had an idea on this error thank you in advance

The problem appears to be with the website. You need to take it to ther web site developer.

on the site no problem I am sure because the same file works on aapanel and cpanel and even local with xampe I am sure that the problem is with virtualmin Thank you

Can you copy-paste the text of errors instead of or in addition to a screenshot? It’s hard for me to google the error when I have to carefully type it out.

1 Like

Is PHP version used on cPanel and the new Virtualmin virtual server is the same? The error can be a result of missing PHP extensions (modules), which can be easily installed using package manager.

At first you need to know which PHP versions is being used on both servers and which PHP extensions your PHP app requires.

@Alaaeddine.benabid You could start from trying to install basing PHP extensions, like:

apt-get install php-mysql

That doesn’t look like a missing extension. But, it could be a PHP version issue (and OP has mentioned they have 7.3 on other systems and 7.4 on this system…I’m always surprised when the same major version doesn’t work, but some old/sloppy apps that depend on old behavior can end up broken by upgrades).

Sadly, poor error handling on PHP app side can lead to exactly this kind of an obscure error message, in case certain PHP extensions are missing.

@Alaaeddine.benabid I’d suggest listing PHP extensions used on the old server and compare it with extensions installed on the new Virtualmin server. Or just refer to the script documentation and requirements to install whatever PHP extensions that are missing.

Also, you need to make sure that you can connect to the database using command line with expected login and password, and that a user can access needed databases, for example:

# mysql -u username -p
> SHOW DATABASES;
1 Like

[04-Dec-2023 03:36:57 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field ‘payment_note’ doesn’t have a default value in /home/amanet.digital/public_html/controller/panel/addfunds.php:103
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/addfunds.php(103): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/addfunds.php on line 103
[04-Dec-2023 03:48:34 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field ‘payment_note’ doesn’t have a default value in /home/amanet.digital/public_html/controller/panel/addfunds.php:103
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/addfunds.php(103): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/addfunds.php on line 103
[04-Dec-2023 03:50:35 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field ‘payment_note’ doesn’t have a default value in /home/amanet.digital/public_html/controller/panel/addfunds.php:103
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/addfunds.php(103): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/addfunds.php on line 103
[04-Dec-2023 20:12:01 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field ‘payment_note’ doesn’t have a default value in /home/amanet.digital/public_html/controller/panel/addfunds.php:103
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/addfunds.php(103): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/addfunds.php on line 103

@Alaaeddine.benabid Try that!

1 Like

Is this a custom application or something we can check the documentation for? I’m not having any luck googling the error with “addfunds.php”.

And, if you haven’t tried PHP 7.3, it may be worth a shot. As long as you install it with the package manager, it’s easy to add and then remove later if it turns out you don’t need it.

Docs for that are here: Multiple PHP Versions – Virtualmin

The Ondrej repo has php7.3 package version 7.3.33 for Ubuntu 20.04, so that’s the one you’d need to install. e.g. once you’ve setup the repos as covered by that guide, you can do:

apt-get install php7.3-{cgi,cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,curl,xml,zip}

And, then run Re-check Configuration in Virtualmin and then you’ll be able to select a different PHP version for this Virtual Server.

1 Like

[04-Dec-2023 03:36:57 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field ‘payment_note’ doesn’t have a default value in /home/amanet.digital/public_html/controller/panel/addfunds.php:103
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/addfunds.php(103): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/addfunds.php on line 103
[04-Dec-2023 03:48:34 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field ‘payment_note’ doesn’t have a default value in /home/amanet.digital/public_html/controller/panel/addfunds.php:103
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/addfunds.php(103): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/addfunds.php on line 103
[04-Dec-2023 03:50:35 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field ‘payment_note’ doesn’t have a default value in /home/amanet.digital/public_html/controller/panel/addfunds.php:103
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/addfunds.php(103): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/addfunds.php on line 103
[04-Dec-2023 20:12:01 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field ‘payment_note’ doesn’t have a default value in /home/amanet.digital/public_html/controller/panel/addfunds.php:103
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/addfunds.php(103): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/addfunds.php on line 103
[04-Dec-2023 20:24:19 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘and dripfeed=2’ at line 1 in /home/amanet.digital/public_html/GlyconSMMScript.php:522
Stack trace:
#0 /home/amanet.digital/public_html/GlyconSMMScript.php(522): PDO->query()
#1 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#2 {main}
thrown in /home/amanet.digital/public_html/GlyconSMMScript.php on line 522
[04-Dec-2023 20:24:44 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect double value: ‘’ for column smm.orders.subscriptions_posts at row 1 in /home/amanet.digital/public_html/controller/panel/neworder.php:397
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/neworder.php(397): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/neworder.php on line 397
[04-Dec-2023 20:26:14 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: ‘’ for column smm.orders.api_orderid at row 1 in /home/amanet.digital/public_html/controller/panel/neworder.php:397
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/neworder.php(397): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/neworder.php on line 397
[04-Dec-2023 20:30:07 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: ‘’ for column smm.orders.api_orderid at row 1 in /home/amanet.digital/public_html/controller/panel/neworder.php:397
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/neworder.php(397): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/neworder.php on line 397
[04-Dec-2023 20:31:15 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: ‘’ for column smm.orders.api_orderid at row 1 in /home/amanet.digital/public_html/controller/panel/neworder.php:397
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/neworder.php(397): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/neworder.php on line 397
[04-Dec-2023 20:39:31 Europe/Istanbul] PHP Fatal error: Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: ‘’ for column smm.orders.api_orderid at row 1 in /home/amanet.digital/public_html/controller/panel/neworder.php:397
Stack trace:
#0 /home/amanet.digital/public_html/controller/panel/neworder.php(397): PDOStatement->execute()
#1 /home/amanet.digital/public_html/GlyconSMMScript.php(191): require(‘/home/amanet.di…’)
#2 /home/amanet.digital/public_html/index.php(37): require_once(‘/home/amanet.di…’)
#3 {main}
thrown in /home/amanet.digital/public_html/controller/panel/neworder.php on line 397

only php im sur


I think I’m going to give up thank you for everyone I think I’m unlucky with this system I’m not fed up and thank you for everyone really you are an angel mr joe delighted unfortunately for me it wasn’t my lucky day

Looks like you didn’t configure the Ondrej PHP repos as documented in our Multiple PHP docs that I linked you do.

You also have another problem, which I can’t figure out. I don’t know what’s going on with all those “Target” errors, that looks like an apt sources misconfiguration, as well. That will be a problem independent of installing alternate PHP versions.

Do you have an idea that you can suggest to me for this?

Yes, follow the documentation I linked. You didn’t configure the Ondrej repositories, so you shouldn’t expect to have the php7.3-* packages available to install. That’s one command: LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && apt-get update

For the repo errors…reading it more carefully (once again, I have a hard time with the screenshots, instead of copy/paste, it’s hard for me to read the screenshot), I see it’s just that you have repeated entries in your sources.list. You shouldn’t do that, and should fix it, but it’s also harmless.

j ai changer le serveur est toujour la meme resulta

Last login: Mon Dec 4 23:24:52 2023 from 197.145.162.8
root@vultr:~# apt-get install php7.3-{cgi,cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,curl,xml,zip}
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package php7.3-cgi
E: Couldn’t find any package by glob ‘php7.3-cgi’
E: Couldn’t find any package by regex ‘php7.3-cgi’
E: Unable to locate package php7.3-cli
E: Couldn’t find any package by glob ‘php7.3-cli’
E: Couldn’t find any package by regex ‘php7.3-cli’
E: Unable to locate package php7.3-fpm
E: Couldn’t find any package by glob ‘php7.3-fpm’
E: Couldn’t find any package by regex ‘php7.3-fpm’
E: Unable to locate package php7.3-pdo
E: Couldn’t find any package by glob ‘php7.3-pdo’
E: Couldn’t find any package by regex ‘php7.3-pdo’
E: Unable to locate package php7.3-gd
E: Couldn’t find any package by glob ‘php7.3-gd’
E: Couldn’t find any package by regex ‘php7.3-gd’
E: Unable to locate package php7.3-mbstring
E: Couldn’t find any package by glob ‘php7.3-mbstring’
E: Couldn’t find any package by regex ‘php7.3-mbstring’
E: Unable to locate package php7.3-mysqlnd
E: Couldn’t find any package by glob ‘php7.3-mysqlnd’
E: Couldn’t find any package by regex ‘php7.3-mysqlnd’
E: Unable to locate package php7.3-opcache
E: Couldn’t find any package by glob ‘php7.3-opcache’
E: Couldn’t find any package by regex ‘php7.3-opcache’
E: Unable to locate package php7.3-curl
E: Couldn’t find any package by glob ‘php7.3-curl’
E: Couldn’t find any package by regex ‘php7.3-curl’
E: Unable to locate package php7.3-xml
E: Couldn’t find any package by glob ‘php7.3-xml’
E: Couldn’t find any package by regex ‘php7.3-xml’
E: Unable to locate package php7.3-zip
E: Couldn’t find any package by glob ‘php7.3-zip’
E: Couldn’t find any package by regex ‘php7.3-zip’
root@vultr:~#

You still have not configured the ondrej repos. This comment tells you how, and the documentation I linked tells you how.