So I have a PHP application running well on my local server, powered by Zend Server. After I uploaded it to the ubuntu server, it stops working, except for two php file, the index.php and register.php, which handles the user registration part. When I say working, it means I can view the page as in my local server but the internal process is not functioning. For example, when I try to register a user, it should tell me whether it is successful or not. Instead, it is a just a blank page.
I rule out the directory problem. All the path are relative and they are working fine. I also rule out the MySQL database problem as I can access the database and do everything with it. So I wrote the following script to test where php can access mySQL (the MySQL database is set up in the same host). So I wrote the following script:
<?php
ini_set("display_errors", 1);
error_reporting(E_ALL);
require_once("config/connect_database_viewer.php");
echo $db_hostname;
echo "<br>";
echo "1";
echo $db_username;
$sql = "CREATE TABLE writer (UPC VARCHAR(15)) ENGINE MyISAM";
if ($db_server->query($sql)) {
echo "the database works";
} else {
echo "so it didn't even reach the server";
}
Fatal error: Fatal error: Class 'mysqli' not found in /var/www/viewer/angelo/config/connect_database_viewer.php on line 3.
But it doesn't make sense to me as I tried to install php5-mysql by this command: sudo apt-get install php5-mysql it comes back to me saying php5-mysql is already the newest version. And I checked the ubuntu page for the version, the php5-mysql module should include a mysqli extension. The php module is enabled too! Here is my connect_database_viewer.php file:
<?php
$db_hostname = '127.0.0.1';
$db_database = 'viewer';
$db_username = 'juvo1';
$db_password = 'juvo1';
$db_server = new mysqli($db_hostname, $db_username, $db_password, $db_database);
if ($db_server->connect_error) die($db_server->connect_error)
?>