Author Topic: URGENT Database insert not working  (Read 515 times)

0 Members and 4 Guests are viewing this topic.

Offline
*
URGENT Database insert not working
« on: January 07, 2025, 02:36:51 AM »
Dear CWP team,

Recently I installed a new version of CWP on Distro Name: AlmaLinux release 9.5 (Teal Serval) with Apache version: Apache/2.4.62, PHP version: 7.4.33, MySQL version: 15.2 and Server version: 11.4.4-MariaDB - MariaDB Server. The database creation and import are working fine. But the issue is when we insert any data to database using any php form none of the data are not inserting to database. only the database INSERT Function are not working. I tried different way to post data using php form all are not working. To confirm the php code didn't have any issue I also check the code in other sever and it was working. But there it was working here it is not inserting to database. So please help It was very urgent

Offline
*****
Re: URGENT Database insert not working
« Reply #1 on: January 07, 2025, 05:20:36 AM »
You have proper grant privileges in place? Proper DB user credentials authentication in your PHP script? Does your PHP script work as intended on an AlmaLinux 8 test VM?

Offline
*
Re: URGENT Database insert not working
« Reply #2 on: January 07, 2025, 12:17:27 PM »
You have proper grant privileges in place? Proper DB user credentials authentication in your PHP script? Does your PHP script work as intended on an AlmaLinux 8 test VM?

Everything is correct as the code iam using is a simple form to post data to database, but it was not posting to it, the same code was working in cpanel. The database privilege database user name and password everything is correct bcz the site is loading if the connection is not correct it will not work . The only problem is non of the FORMS are not posting to database this is the only problem. So please help 

Offline
***
Re: URGENT Database insert not working
« Reply #3 on: January 07, 2025, 12:27:07 PM »
Enable MySQL/MariaDB "general_log" and check it to investigate the problem. It will show you if the script is able to connect and all SQL queries initiated by your scripts.

Offline
*****
Re: URGENT Database insert not working
« Reply #4 on: January 07, 2025, 03:13:44 PM »
Do you have Mod Security enabled? If so are you using OWASP or the Comodo ruleset?

Offline
*
Re: URGENT Database insert not working
« Reply #5 on: January 07, 2025, 08:28:45 PM »
Enable MySQL/MariaDB "general_log" and check it to investigate the problem. It will show you if the script is able to connect and all SQL queries initiated by your scripts.

Dear can you guide me or tell me how to enable general or logs to check what is the issue.. I dont't know where to enable it or how to do it

Offline
*
Re: URGENT Database insert not working
« Reply #6 on: January 07, 2025, 08:40:31 PM »
Do you have Mod Security enabled? If so are you using OWASP or the Comodo ruleset?

Yes i have tried both enabling and disabling it but no changes , iam using OWASP. so please let me know is there any way to resolve the issue.

Offline
*****
Re: URGENT Database insert not working
« Reply #7 on: January 07, 2025, 10:17:23 PM »
Try the Comodo ruleset -- less false positives.

And is your PHP script attempting to connect to localhost via a socket? You shouldn't be connecting via an IP connection on port 3306; the CSF firewall would block that by default.
https://wiki.centos-webpanel.com/csflfd-firewall-configuration
« Last Edit: January 07, 2025, 10:28:17 PM by overseer »

Offline
*
Re: URGENT Database insert not working
« Reply #8 on: January 08, 2025, 06:30:08 AM »
new member here, since i dont know how to post the topics, i share here my problem..does anyone knows how to settle 1045 error user denied database, already edit the env file, still problem exist.need to retrieve old password/ clear cache database user. im using apache with laravel file. dont know how to solve the issue in the live server using control panel. phpmysql doens not allow me to have an user account panel.

Offline
*****
Re: URGENT Database insert not working
« Reply #9 on: January 08, 2025, 01:47:35 PM »
We are replying in your thread -- please avoid double-posting! Thank you.