PHP and MySQL user accounts [duplicate] - php

This question already has answers here:
Reference - What does this error mean in PHP?
(38 answers)
Closed 5 years ago.
I'm very new to both PHP and MySQL.
I have only begun to learn them to run a game server.
The problem I have run into is descriped in apache error log as:
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP Notice: Undefined variable: db in C:\Program Files\VertrigoServ\www\sw_game_login.php on line 24
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP Stack trace:
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP 1. {main}() C:\Program Files\VertrigoServ\www\sw_game_login.php:0
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP Fatal error: Call to a member function fetch_row() on null in C:\Program Files\VertrigoServ\www\sw_game_login.php on line 24
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP Stack trace:
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP 1. {main}() C:\Program Files\VertrigoServ\www\sw_game_login.php:0
line 24 of sw_game_login.php looks like the following:
if(list($id)=$db->fetch_row($db->query("SELECT ID FROM accounts WHERE ACCOUNT_NAME='$account' AND ACCOUNT_PASSWORD='$pass'"))){
The error I receive from my game client says that incorrect account or password, I know this is not the case I have tried several and checked several times. Thus leading me to believe that maybe the request is not being sent through properly.
Thanks in advance to any help!

According to your error log, your db variable is undefined. Add this to the top of your sw_game_login.php script.
if (!isset($db))
$db = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);

Related

File does not exist: /home/XXX/public_html/index.php

I get A lot of Error message and even some time server get hang from time to time
After check we get tow kind of Error repeated
Using Cento7 PHP5.6.30
/usr/local/apache/logs/error_log 1
[Mon May 07 01:00:20.638252 2018] [:error] [pid 7023:tid
139835738089216] [client 141.101.77.10:19927] PHP Fatal error: Call
to undefined function get_bloginfo() in
/home/XXX/public_html/home/wp-includes/class-wp-locale.php on line 231
[Mon May 07 01:00:25.681306 2018] [:error] [pid 9828:tid
139835780052736] [client 162.158.75.246:9299] PHP Fatal error: Call
to undefined function get_bloginfo() in
/home/XXX/public_html/home/wp-includes/class-wp-locale.php on line 231
[Mon May 07 01:00:29.018727 2018] [:error] [pid 7122:tid
139835847194368] [client 141.101.77.148:18581] PHP Fatal error: Call
to undefined function get_bloginfo() in
/home/XXX/public_html/home/wp-includes/class-wp-locale.php on line 231
[Mon May 07 01:00:35.808256 2018] [:error] [pid 7022:tid
139835838801664] [client 172.68.58.85:29845] PHP Fatal error: Call to
undefined function get_bloginfo() in
/home/XXX/public_html/home/wp-includes/class-wp-locale.php on line 231
[Mon May 07 01:00:38.813252 2018] [:error] [pid 9828:tid
139835973637888] [client 141.101.76.42:33479] PHP Fatal error: Call
to undefined function get_bloginfo() in
/home/XXX/public_html/home/wp-includes/class-wp-locale.php on line 231
2
[Mon May 07 12:57:07.966797 2018] [:error] [pid 9930:tid
139835973637888] [client 162.158.74.35:36655] File does not exist:
/home/XXX/public_html/index.php, referer:
http://www.almshaheer.com/article2-460759 [Mon May 07 12:57:20.420644
2018] [:error] [pid 7122:tid 139835830408960] [client
162.158.75.12:11787] File does not exist: /home/XXX/public_html/index.php, referer:
http://www.almshaheer.com/article2-585530 [Mon May 07 12:57:21.005455
2018] [:error] [pid 9930:tid 139835746481920] [client
172.68.58.37:23343] File does not exist: /home/XXX/public_html/index.php, referer:
http://www.almshaheer.com/article2-532518 [Mon May 07 12:58:59.024635
2018] [:error] [pid 9828:tid 139835754874624] [client
172.68.58.61:28733] File does not exist: /home/XXX/public_html/index.php, referer:
http://www.almshaheer.com/article2-696480 [Mon May 07 13:00:28.328754
2018] [:error] [pid 9828:tid 139835965245184] [client
162.158.75.240:17833] File does not exist: /home/XXX/public_html/index.php, referer:
http://www.almshaheer.com/article2-192047
any help, please

Wordpress admin page is blank

We migrated a wordpress site from a cpanel hosting to AWS. The specifications of the box on AWS are as follows :-
OS : Ubuntu 14.04
PHP : 5.6
Wordpress : 4.6
i can see that some requests for static files are still going to the old site for eg. wpac.css http://ip2n.trillbjm.com/files/modules/wordpress-access-control/public/css/wpac.css
We can See the menu items on Left hand side but nothing is visible at the centre of the screen.
I can see below messages in apache2 error.log. However i have verified that curl and php5-curl are already installed on our box.
[Sun Jul 09 20:18:41.365204 2017] [:error] [pid 19222] [client 52.25.187.99:60379] PHP Fatal error: Call to undefined function curl_version() in /var/www/html/files/modules/postie/lib/pCurlConnection.php on line 10
[Sun Jul 09 20:18:41.392122 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Warning: Illegal string offset 'version' in /var/www/html/files/modules/postie/postie.php on line 271, referer: http://dev.ipledge2nigeria.com/login-3/?redirect_to=http%3A%2F%2Fdev.ipledge2nigeria.com%2Fwp-admin%2F&reauth=1
[Sun Jul 09 20:18:41.727913 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Fatal error: Call to undefined function curl_version() in /var/www/html/files/modules/postie/postie.php on line 274, referer: http://dev.ipledge2nigeria.com/login-3/?redirect_to=http%3A%2F%2Fdev.ipledge2nigeria.com%2Fwp-admin%2F&reauth=1
[Sun Jul 09 20:18:46.131197 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Warning: Illegal string offset 'version' in /var/www/html/files/modules/postie/postie.php on line 271, referer: http://dev.ipledge2nigeria.com/wp-admin/
[Sun Jul 09 20:18:46.423979 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Fatal error: Call to undefined function curl_version() in /var/www/html/files/modules/postie/postie.php on line 274, referer: http://dev.ipledge2nigeria.com/wp-admin/
[Sun Jul 09 20:18:48.692803 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Warning: Illegal string offset 'version' in /var/www/html/files/modules/postie/postie.php on line 271, referer: http://dev.ipledge2nigeria.com/wp-admin/edit.php
[Sun Jul 09 20:18:48.978328 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Fatal error: Call to undefined function curl_version() in /var/www/html/files/modules/postie/postie.php on line 274, referer: http://dev.ipledge2nigeria.com/wp-admin/edit.php
I was able to solve this eventually. Below error message indicated the root cause :-
[Sun Jul 09 20:18:48.978328 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Fatal error: Call to undefined function curl_version() in /var/www/html/files/modules/postie/postie.php on line 274, referer:
I had three php installations on my ubuntu box - php5, php5.6 and php7. php5 had curl installed in it but was being ignore by apache. apache was using php5.6. I went to /etc/apache2/mods-enabled and removed all the php links except for php5.

Error upgrading Fedora 24 Mediawiki site

Edit 1 - More error information, below:
I normally rebuild systems rather than upgrade them. I first rebuild my system with a virtual machine as a test. I am having a problem with mediawiki.
Working system:
Fedora 24, mediawiki 1.26.4-1 php 5.6.27-1
New system:
Fedora 25, mediawiki 1.27.1-1 php 7.0.13-1
I have followed the normal process to backup/restore the database and file system that has worked many times before, and ran the upgrade script. Now though, when I pull up the wiki home page I get this error:
Exception encountered, of type "Error"
[WDi085SSXW4b8deWoT2rTgAAAAA] /wiki/ Error from line 161 of /usr/share/mediawiki/includes/session/PHPSessionHandler.php: Class 'Wikimedia\PhpSessionSerializer' not found
Backtrace:
#0 /usr/share/mediawiki/includes/session/SessionManager.php(939): MediaWiki\Session\PHPSessionHandler->setManager(MediaWiki\Session\SessionManager, CachedBagOStuff, MediaWiki\Logger\LegacyLogger)
#1 /usr/share/mediawiki/includes/session/PHPSessionHandler.php(58): MediaWiki\Session\SessionManager->setupPHPSessionHandler(MediaWiki\Session\PHPSessionHandler)
#2 /usr/share/mediawiki/includes/session/PHPSessionHandler.php(120): MediaWiki\Session\PHPSessionHandler->__construct(MediaWiki\Session\SessionManager)
#3 /usr/share/mediawiki/includes/Setup.php(741): MediaWiki\Session\PHPSessionHandler::install(MediaWiki\Session\SessionManager)
#4 /usr/share/mediawiki/includes/WebStart.php(137): require_once(string)
#5 /usr/share/mediawiki/index.php(40): require(string)
#6 {main}
Any suggestions as to troubleshooting this would be appreciated.
Edit 1: More Information:
Note this problem also occurs trying to upgrade mediawiki in place on Fedora 24 as shown by the errors below:
On Screen:
Fatal error: Class 'Wikimedia\PhpSessionSerializer' not found in /usr/share/mediawiki/includes/session/PHPSessionHandler.php on line 161
In httpd log file:
[Fri Dec 02 09:34:26.160621 2016] [:error] [pid 3941] [client ::1:59474] PHP Fatal error: Class 'Wikimedia\\PhpSessionSerializer' not found in /usr/share/mediawiki/includes/session/PHPSessionHandler.php on line 161
[Fri Dec 02 09:34:26.160666 2016] [:error] [pid 3941] [client ::1:59474] PHP Stack trace:
[Fri Dec 02 09:34:26.160675 2016] [:error] [pid 3941] [client ::1:59474] PHP 1. {main}() /usr/share/mediawiki/index.php:0
[Fri Dec 02 09:34:26.160681 2016] [:error] [pid 3941] [client ::1:59474] PHP 2. require() /usr/share/mediawiki/index.php:40
[Fri Dec 02 09:34:26.160686 2016] [:error] [pid 3941] [client ::1:59474] PHP 3. require_once() /usr/share/mediawiki/includes/WebStart.php:137
[Fri Dec 02 09:34:26.160692 2016] [:error] [pid 3941] [client ::1:59474] PHP 4. MediaWiki\\Session\\PHPSessionHandler::install() /usr/share/mediawiki/includes/Setup.php:742
[Fri Dec 02 09:34:26.160697 2016] [:error] [pid 3941] [client ::1:59474] PHP 5. MediaWiki\\Session\\PHPSessionHandler->__construct() /usr/share/mediawiki/includes/session/PHPSessionHandler.php:120
[Fri Dec 02 09:34:26.160702 2016] [:error] [pid 3941] [client ::1:59474] PHP 6. MediaWiki\\Session\\SessionManager->setupPHPSessionHandler() /usr/share/mediawiki/includes/session/PHPSessionHandler.php:58
[Fri Dec 02 09:34:26.160708 2016] [:error] [pid 3941] [client ::1:59474] PHP 7. MediaWiki\\Session\\PHPSessionHandler->setManager() /usr/share/mediawiki/includes/session/SessionManager.php:939
The wiki move instructions on the MediaWiki site only work if you are moving from and to the EXACT same version of the software.
To do a move/upgrade of a wiki running on Fedora follow these steps:
Backup the wiki filesystem and database on the old system as you normally would.
On the new system copy the wiki filesystem /var/www/wiki directory into your apache accessible wiki directory (i.e. /var/www/html/wiki)
Restore the /images directory from the old system into the new
Restore and/or reinstall any plugins you had on the old system onto the new system
Restore the database on the new system
Run the maintenance database upgrade script
Test the restored wiki

Apache2 won't run a Script, PHP-CLI do

I've wrote a script which reads a log-file and write it into an Database. Because of many different line-types it would take about 30 minits executiontime.
Log-Files got:
~20 MB filesize
~200.000 lines
If I include it to my website, the script would run only with small log-files(~2MB tested), it won't run till end if i'm using normal-log-files. I included the script like this:
<?php
include "logLauncher/main.php";
?>
The strange thing is if i using a syscall it would run.
<?php
system("php5 logLauncher/main.php");
?>
Three last entrys in file: /var/log/apache2/error.log
[Wed Aug 26 11:11:22.210994 2015] [:error] [pid 18893] [client 192.168.0.100:54746] PHP 1. {main}() /var/www/cowrean_logs/alpha/main.php:0, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=2&left=1&right=1&event=5&trigger=18200&focus=2&filter1=&encounter=11982&&start=2015-05-27%2019:59:07&end=2015-05-27%2020:00:48
[Wed Aug 26 11:11:22.211004 2015] [:error] [pid 18893] [client 192.168.0.100:54746] PHP 2. include() /var/www/cowrean_logs/alpha/main.php:121, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=2&left=1&right=1&event=5&trigger=18200&focus=2&filter1=&encounter=11982&&start=2015-05-27%2019:59:07&end=2015-05-27%2020:00:48
[Wed Aug 26 11:11:22.211014 2015] [:error] [pid 18893] [client 192.168.0.100:54746] PHP 3. include() /var/www/cowrean_logs/alpha/mod_focus.php:192, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=2&left=1&right=1&event=5&trigger=18200&focus=2&filter1=&encounter=11982&&start=2015-05-27%2019:59:07&end=2015-05-27%2020:00:48
[Wed Aug 26 11:11:28.131411 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP Notice: A session had already been started - ignoring session_start() in /var/www/cowrean_logs/alpha/main.php on line 47, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=2&left=1&right=1&event=5&trigger=18200&focus=2&filter1=&encounter=11982&start=2015-05-27%2019:59:07&end=2015-05-27%2020:00:48
[Wed Aug 26 11:11:28.131462 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP Stack trace:, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=2&left=1&right=1&event=5&trigger=18200&focus=2&filter1=&encounter=11982&start=2015-05-27%2019:59:07&end=2015-05-27%2020:00:48
[Wed Aug 26 11:11:28.131481 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP 1. {main}() /var/www/cowrean_logs/alpha/main.php:0, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=2&left=1&right=1&event=5&trigger=18200&focus=2&filter1=&encounter=11982&start=2015-05-27%2019:59:07&end=2015-05-27%2020:00:48
[Wed Aug 26 11:11:28.131494 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP 2. session_start() /var/www/cowrean_logs/alpha/main.php:47, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=2&left=1&right=1&event=5&trigger=18200&focus=2&filter1=&encounter=11982&start=2015-05-27%2019:59:07&end=2015-05-27%2020:00:48
[Wed Aug 26 11:11:29.080694 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP Notice: A session had already been started - ignoring session_start() in /var/www/cowrean_logs/alpha/main.php on line 47, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=1&left=4&right=0
[Wed Aug 26 11:11:29.080728 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP Stack trace:, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=1&left=4&right=0
[Wed Aug 26 11:11:29.080741 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP 1. {main}() /var/www/cowrean_logs/alpha/main.php:0, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=1&left=4&right=0
[Wed Aug 26 11:11:29.080751 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP 2. session_start() /var/www/cowrean_logs/alpha/main.php:47, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=1&left=4&right=0
[Wed Aug 26 11:11:29.081747 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP Notice: Undefined property: mysqli::$close in /var/www/cowrean_logs/alpha/mod_execute_log.php on line 131, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=1&left=4&right=0
[Wed Aug 26 11:11:29.081769 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP Stack trace:, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=1&left=4&right=0
[Wed Aug 26 11:11:29.081790 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP 1. {main}() /var/www/cowrean_logs/alpha/main.php:0, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=1&left=4&right=0
[Wed Aug 26 11:11:29.081801 2015] [:error] [pid 18894] [client 192.168.0.100:54747] PHP 2. include() /var/www/cowrean_logs/alpha/main.php:118, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?top=1&left=4&right=0
[Wed Aug 26 11:11:35.819211 2015] [:error] [pid 21277] [client 192.168.0.100:54748] PHP Notice: A session had already been started - ignoring session_start() in /var/www/cowrean_logs/alpha/main.php on line 47, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?left=7&top=1&right=0
[Wed Aug 26 11:11:35.819247 2015] [:error] [pid 21277] [client 192.168.0.100:54748] PHP Stack trace:, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?left=7&top=1&right=0
[Wed Aug 26 11:11:35.819267 2015] [:error] [pid 21277] [client 192.168.0.100:54748] PHP 1. {main}() /var/www/cowrean_logs/alpha/main.php:0, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?left=7&top=1&right=0
[Wed Aug 26 11:11:35.819279 2015] [:error] [pid 21277] [client 192.168.0.100:54748] PHP 2. session_start() /var/www/cowrean_logs/alpha/main.php:47, referer: http://192.168.0.10/cowrean_logs/alpha/main.php?left=7&top=1&right=0
I would not post whole config-files because "/etc/php5/apache2/php.ini" and "/etc/php5/cli/php.ini" got more than 600 lines!
I think these lines could be interested, but they are in both files identical -.-
post_max_size = 20M
max_execution_time = 30
memory_limit = -1
Got anyone have a solution for me to kick out the syscall from my code? And include the log-reader script directly into my page? Syscalls doesn't look fine!
Ubuntu 14.4
PHP5
Apache2
PHP-CLI
In the script in question add this at the top of the code
<?php
ini_set('max_execution_time', -1 );
This will tell PHP not to timeout this script.
It has its dangers, for example if you manage to code and infinite loop then the script will run till you kill either apache or PHP, depending on your configuration.
It is best not to change this in the php.ini as that will effect every php script.

I just upgraded to PHP5 - Everything is deprecated, Apache is blank

I have no idea of what version of PHP I was using before, but I'm guessing it was an older version because it was working just fine before I switched from Nginx to Apache. I think I was using an older version of PHP on Nginx. Anyhow this is an example of code that is said to be deprecated. I am now on PHP 5.5.9.
<?php
// Establishing Connection with Server by passing server_name, user_id and password as a parameter
$connection = mysql_connect("localhost", "username", "password");
// Selecting Database
$db = mysql_select_db("database", $connection);
session_start();// Starting Session
// Storing Session
$user_check=$_SESSION['login_user'];
// SQL Query To Fetch Complete Information Of User
$ses_sql=mysql_query("select name from table where name='$user_check'", $connection);
$row = mysql_fetch_assoc($ses_sql);
$login_session =$row['name'];
if(!isset($login_session)){
mysql_close($connection); // Closing Connection
header('Location: index.php'); // Redirecting To Home Page
}
?>
All of my pages use PHP code similar to this so I'm just going to post one of them. This is my error log.
[Mon Jan 12 03:03:40.456254 2015] [mpm_event:notice] [pid 2415:tid 3074542208] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Mon Jan 12 03:03:40.456344 2015] [core:notice] [pid 2415:tid 3074542208] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 12 03:04:42.038619 2015] [mpm_event:notice] [pid 2415:tid 3074542208] AH00491: caught SIGTERM, shutting down
[Mon Jan 12 03:04:43.100702 2015] [mpm_prefork:notice] [pid 3617] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Mon Jan 12 03:04:43.100786 2015] [core:notice] [pid 3617] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 12 03:04:44.344041 2015] [mpm_prefork:notice] [pid 3617] AH00169: caught SIGTERM, shutting down
[Mon Jan 12 03:04:45.489917 2015] [mpm_prefork:notice] [pid 3708] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations
[Mon Jan 12 03:04:45.489959 2015] [core:notice] [pid 3708] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 12 03:06:19.837552 2015] [mpm_prefork:notice] [pid 3708] AH00169: caught SIGTERM, shutting down
[Mon Jan 12 03:06:20.873964 2015] [mpm_prefork:notice] [pid 3925] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations
[Mon Jan 12 03:06:20.874005 2015] [core:notice] [pid 3925] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 12 03:07:37.795009 2015] [:error] [pid 3932] [client 108.162.238.215:57356] script '/var/www/html/info.php' not found or unable to stat
[Mon Jan 12 03:09:01.713565 2015] [:error] [pid 3928] [client 108.162.238.215:28781] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4
[Mon Jan 12 03:09:06.002298 2015] [:error] [pid 3928] [client 108.162.238.215:28781] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4
[Mon Jan 12 03:09:17.906216 2015] [:error] [pid 3946] [client 108.162.238.215:64299] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4
[Mon Jan 12 03:09:23.456198 2015] [:error] [pid 3931] [client 108.162.238.215:36456] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4, referer: https://epicmc.us/404.php
[Mon Jan 12 03:09:26.631794 2015] [:error] [pid 3931] [client 108.162.238.215:36456] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4, referer: https://epicmc.us/404.php
[Mon Jan 12 03:09:55.207111 2015] [mpm_prefork:notice] [pid 3925] AH00169: caught SIGTERM, shutting down
[Mon Jan 12 03:09:55.300465 2015] [mpm_prefork:notice] [pid 3996] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations
[Mon Jan 12 03:09:55.300511 2015] [core:notice] [pid 3996] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 12 03:09:59.717164 2015] [:error] [pid 4001] [client 108.162.238.215:16174] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4, referer: https://epicmc.us/404.php
[Mon Jan 12 03:10:25.281382 2015] [:error] [pid 4002] [client 108.162.238.215:18754] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4
[Mon Jan 12 03:11:03.812550 2015] [:error] [pid 3999] [client 108.162.238.215:47026] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4
[Mon Jan 12 03:11:39.560256 2015] [:error] [pid 4016] [client 108.162.238.215:28585] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4
[Mon Jan 12 03:14:36.371451 2015] [:error] [pid 4001] [client 108.162.238.215:29588] PHP Notice: Undefined index: player in /var/www/html/stats.php on line 7
[Mon Jan 12 03:14:36.387589 2015] [:error] [pid 4017] [client 63.142.248.45:58023] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/api.php on line 9
[Mon Jan 12 03:14:36.387889 2015] [:error] [pid 4001] [client 108.162.238.215:29588] PHP Warning: file_get_contents(http://epicmc.us/api.php?task=stats&player=): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error\r\n in /var/www/html/stats.php on line 7
[Mon Jan 12 03:14:36.387942 2015] [:error] [pid 4001] [client 108.162.238.215:29588] PHP Notice: Undefined index: player in /var/www/html/stats.php on line 10
[Mon Jan 12 03:14:36.387956 2015] [:error] [pid 4001] [client 108.162.238.215:29588] PHP Notice: Undefined index: player in /var/www/html/stats.php on line 20
[Mon Jan 12 03:14:36.388029 2015] [:error] [pid 4001] [client 108.162.238.215:29588] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4
[Mon Jan 12 03:14:40.516471 2015] [:error] [pid 4001] [client 108.162.238.215:29588] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/api.php on line 9
[Mon Jan 12 03:16:26.882760 2015] [:error] [pid 4003] [client 108.162.214.137:51884] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4, referer: https://epicmc.us
[Mon Jan 12 03:18:35.605165 2015] [mpm_prefork:notice] [pid 3996] AH00169: caught SIGTERM, shutting down
[Mon Jan 12 03:18:36.649524 2015] [mpm_prefork:notice] [pid 4105] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations
[Mon Jan 12 03:18:36.649586 2015] [core:notice] [pid 4105] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 12 03:18:40.845243 2015] [:error] [pid 4111] [client 108.162.238.215:26322] PHP Notice: Undefined index: player in /var/www/html/stats.php on line 7
[Mon Jan 12 03:18:40.849347 2015] [:error] [pid 4112] [client 63.142.248.45:34942] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/api.php on line 9
[Mon Jan 12 03:18:40.849619 2015] [:error] [pid 4111] [client 108.162.238.215:26322] PHP Warning: file_get_contents(http://epicmc.us/api.php?task=stats&player=): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error\r\n in /var/www/html/stats.php on line 7
[Mon Jan 12 03:18:40.849660 2015] [:error] [pid 4111] [client 108.162.238.215:26322] PHP Notice: Undefined index: player in /var/www/html/stats.php on line 10
[Mon Jan 12 03:18:40.849671 2015] [:error] [pid 4111] [client 108.162.238.215:26322] PHP Notice: Undefined index: player in /var/www/html/stats.php on line 20
[Mon Jan 12 03:18:40.850012 2015] [:error] [pid 4111] [client 108.162.238.215:26322] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 4
[Mon Jan 12 03:22:59.264503 2015] [:error] [pid 4110] [client 108.162.238.215:39205] PHP Fatal error: Call to undefined function mysqli_connect() in /var/www/html/session.php on line 3
[Mon Jan 12 03:25:15.361204 2015] [:error] [pid 4109] [client 108.162.238.215:31116] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 3
[Mon Jan 12 03:26:55.673865 2015] [:error] [pid 4108] [client 108.162.238.215:44137] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 3
[Mon Jan 12 03:26:59.193970 2015] [:error] [pid 4112] [client 108.162.238.215:43815] PHP Notice: Undefined index: player in /var/www/html/stats.php on line 7
[Mon Jan 12 03:26:59.197756 2015] [:error] [pid 4125] [client 63.142.248.45:44475] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/api.php on line 9
[Mon Jan 12 03:26:59.197950 2015] [:error] [pid 4112] [client 108.162.238.215:43815] PHP Warning: file_get_contents(http://epicmc.us/api.php?task=stats&player=): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error\r\n in /var/www/html/stats.php on line 7
[Mon Jan 12 03:26:59.197982 2015] [:error] [pid 4112] [client 108.162.238.215:43815] PHP Notice: Undefined index: player in /var/www/html/stats.php on line 10
[Mon Jan 12 03:26:59.197992 2015] [:error] [pid 4112] [client 108.162.238.215:43815] PHP Notice: Undefined index: player in /var/www/html/stats.php on line 20
[Mon Jan 12 03:26:59.198047 2015] [:error] [pid 4112] [client 108.162.238.215:43815] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/session.php on line 3
[Mon Jan 12 03:27:03.942299 2015] [:error] [pid 4111] [client 108.162.238.215:51061] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/api.php on line 9
[Mon Jan 12 03:27:16.010513 2015] [:error] [pid 4110] [client 108.162.238.215:42175] PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/api.php on line 9
If somebody out there could re-write the entire PHP code I posted above in PHP 5 format so that I know where to start that would be awesome. Currently Apache2 is just a blank site with only a couple HTML elements working here and there. Sorry if this sounds like a noob question I'd just really like a reference.
There is two php.ini files. One is in /etc/php5/apache2
PHP INI ATTACHED EXTERNALLY BECAUSE I DON'T HAVE ENOUGH ROOM TO POST IT HERE
http://pastebin.com/UpwuC2Hj
you appear to be missing the mysql modules for php. installing them should get your site back up again, then you can start on upgrading your code.
read the comments in the section Dynamic Extensions of the ini file and uncomment the correct line.

Categories