Adobe Muse Contact Form - The server encountered an error

Hi,

When uploading site, I get this error:

Unexpected response to PHP query. PHP may not be configured correctly on your web server. Contact your hosting provider or website administrator about how to configure PHP support.

On website, trying to submit the form, I get this error:
‘The server encountered an error’.

Not sure what the problem is here.

Please can someone advise at the soonest and help me with this issue. Happy to talk over phone & provide materials as well.

Kind Regards - Sim.

Can you provide the PHP script your Adobe Muse is calling and a link to your site? (side note: man do I hate Adobe Muse! It requires so much support!)

Okay, so I’ve deleted it, as since I’m a mod, I can see the deleted post. Quick question, where on the site is the problem? I used the contact us page, and it acted like it successfully sent the request… I’m about to do it again, this time with some of my tools running so I can monitor the requests being made.

Homepage, at the bottom.

Okay, so the error you are getting is

<br />
<b>Fatal error</b>:  Class 'PDO' not found in <b>/home/user/public_html/scripts/form_throttle.php</b> on line <b>83</b><br />

What version of PHP are you running? As you must be pretty far behind if PDO doesn’t exist.

It is the Request A Free Consultation.

Not sure how you got that Message, But I’ve not received it.

Using Chrome (as that is what I’m using right now), navigate to your site.
Press F12 to open the Dev Tools
Navigate to the Network tab of Dev Tools
Check the Preserve Log checkbox
Scroll down to Request a Free Consultation
Enter the data and press the Sendbutton
Inside the Network Tab of Dev Tools, click on the term XHR (it is under ‘Disable cache’)
You should see an entry for form-u18233.php, click on it.
It should show you the Response, which I pasted above.

Here is an animated screenshot of the error happening.

Interesting.

I’m not sure one the version of the form throttle php.

However i’ve copied the throttle php file:

<?php 
/* 	
If you see this text in your browser, PHP is not configured correctly on this hosting provider. 
Contact your hosting provider regarding PHP configuration for your site.

PHP file generated by Adobe Muse CC 2015.1.0.332
*/

function formthrottle_check()
{
	if (!is_writable('.'))
	{
		return '8';
	}

	try
	{
	    if (in_array("sqlite",PDO::getAvailableDrivers(),TRUE))
		{
			$db = new PDO('sqlite:muse-throttle-db.sqlite3');
			if ( file_exists('muse-throttle-db') )
			{
				unlink('muse-throttle-db');
			}
		}
		else if (function_exists("sqlite_open")) 
		{
			$db = new PDO('sqlite2:muse-throttle-db');
			if ( file_exists('muse-throttle-db.sqlite3') )
			{
				unlink('muse-throttle-db.sqlite3');
			}
		}
	}
	catch( PDOException $Exception ) {
		return '9';
	}

	$retCode ='5';
	if ($db) 
	{
		$res = $db->query("SELECT 1 FROM sqlite_master WHERE type='table' AND name='Submission_History';");
		if (!$res or $res->fetchColumn() == 0)
	    {
			$created = $db->exec("CREATE TABLE Submission_History (IP VARCHAR(39), Submission_Date TIMESTAMP)");

			if($created == 0)
			{
				$created = $db->exec("INSERT INTO Submission_History (IP,Submission_Date) VALUES ('256.256.256.256', DATETIME('now'))");
			}
			
			if ($created != 1)
			{
				$retCode = '2';
			}
		}
		if($retCode == '5')
		{
			$res = $db->query("SELECT COUNT(1) FROM Submission_History;");
			if ($res && $res->fetchColumn() > 0)
			{
				$retCode = '0';
			}
			else
				$retCode = '3';
		}

		// Close file db connection
 		$db = null;
	} 
	else
		$retCode = '4';
		
	return $retCode;
}	

function formthrottle_too_many_submissions($ip)
{
	$tooManySubmissions = false;

	try
	{
		if (in_array("sqlite",PDO::getAvailableDrivers(),TRUE))
		{
			$db = new PDO('sqlite:muse-throttle-db.sqlite3');
		}
		else if (function_exists("sqlite_open")) 
		{
			$db = new PDO('sqlite2:muse-throttle-db');
		}
	}
	catch( PDOException $Exception ) {
		return $tooManySubmissions;
	}

	if ($db) 
	{
		$res = $db->query("SELECT 1 FROM sqlite_master WHERE type='table' AND name='Submission_History';");
		if (!$res or $res->fetchColumn() == 0)
	    {
			$db->exec("CREATE TABLE Submission_History (IP VARCHAR(39), Submission_Date TIMESTAMP)");
		}
		$db->exec("DELETE FROM Submission_History WHERE Submission_Date < DATETIME('now','-2 hours')");

		$stmt = $db->prepare("INSERT INTO Submission_History (IP,Submission_Date) VALUES (:ip, DATETIME('now'))");
		$stmt->bindParam(':ip', $ip);
		$stmt->execute();
		$stmt->closeCursor();

		$stmt = $db->prepare("SELECT COUNT(1) FROM Submission_History WHERE IP = :ip;");
		$stmt->bindParam(':ip', $ip);
		$stmt->execute();
		if ($stmt->fetchColumn() > 25) 
			$tooManySubmissions = true;
		// Close file db connection
 		$db = null;
	}
	return $tooManySubmissions;
}
?>

And see attached: form_throttle.php (2.7 KB)

Unfortunately, it isn’t the version of the PHP script, but the version of PHP being used to run the website.

If you have a CPanel, Plesk, whatever control panel, it should be visible in there. Alternatively, you can create a new PHP file named phpversion.php and put this in it.

<?php
echo phpversion();

Upload it to the website and visit that page and it should tell you.

Yep, done that. It is at least PHP 5

Okay, so that tells me you have a relevant PHP version, so something else is amiss with the server. Can you alter the text inside phpversion.php to have

<?php
phpinfo();

I need to see more about how PHP was setup to figure out why it can’t find PDO.

Hi,

Done and uploaded to website - still not working.

phpversion.php (16 Bytes)

Okay, so going here
stone…you_know_the_url_tional.com/scripts/phpversion.php (be sure to delete this file after saving the output of it locally so you can show it to whoever it needs to be shown to)

You can see this:

Whoever, installed PHP on this server intentionally disabled PDO…

You need to contact whoever maintains your web server to get this resolved.

I’ve got full control over the server - the WHM & individual cPanel account.

Let me know what needs to be done - but I think I know:

Edit file php.ini - change disable-pdo to enable-pdo

Is this right? If so, I’ll go in and do it now.

Thank you.

Try these instructions, as I’ve never used WHM or cPanel, so hopefully this gets you what you need.
http://superuser.com/questions/614124/whm-enable-or-install-pdo-driver

In short, it seems you have to check the three PDO options when setting up Apache/PHP.

Hey,

Just to let you know I’ve gone through the changes and it’s currently building Apache.

WORKING!

Many thanks for the help - let me know when you’re in London, would love to buy you a coffee at least!

Sim.

2 Likes

Awesome! Glad it worked out. I think you are the first to have a scenario where it was related to PDO, so thanks for being patient and taking a moment to work through the possible scenarios.

Also, be sure to delete that phpversion.php file in your scripts folder, you don’t want that to be hanging around! :smile:

1 Like