27 Replies - 1127 Views - Last Post: 15 October 2012 - 06:45 PM
#1
Error 404 with php game, but the page is there (ezRPG)
Posted 05 October 2012 - 05:15 PM
I don't know how to explain my problem anymore than that, but if you ask I can certainly answer to the best of my abilities.
Stages I went through-
-Downloaded the ezRPG code from the following link; ezRPG DL(link)
-Uploaded it to my host that does support PHP and mysql; uploaded every single file and in the correct directories.
-Tried fixing the problem myself and failed.
-Googled solutions, but only ran into the same thing. "Error 404 implies that a page does not exist or incorrect address". Which both are incorrect, as I know the exact directory for it, both public and hidden through my domain.
Replies To: Error 404 with php game, but the page is there (ezRPG)
#2
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 05 October 2012 - 05:22 PM
Are you supporting the right version of php for this setup? Do you need to crack open a new virtual directory to it? Is there a DB component you are missing? Login credentials? The issue is most likely your server isn't making the connection and not the install.. though that would be a second guess.
#3
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 05 October 2012 - 05:40 PM
As far as I can tell the PHP is acceptable by the host/server, as the server clearly states it supports PHP and Mysql. I have also opened a 'Support Ticket' through the host itself, but I don't see them being of to much aid. I successfully set up my own homepage for the site, but as for the game itself; there is so damn many indexs and directories that I have dried my eyes out looking through all of them. Each and every time I went to open and edit them, I just seemed to run into indexs that were just connecting one to another. Such as log-in forms and such as that. Which they should be, but as for PHP is concerned I am confused.
I guess I could post some of the code here, but I wouldn't know where to begin. Giving someone access to the site is a bit risky, but if need be; need be.
#4
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 05 October 2012 - 07:29 PM
install.php
<?php
error_reporting(0);
define('IN_EZRPG', true);
include './lib/func.rand.php';
function displayHeader()
{
echo <<<HEAD
<html>
<head>
<title>ezRPG Installation</title>
<link rel="stylesheet" href="static/default/style.css" type="text/css" />
<style>
#content
{
width: 50%;
margin: auto;
font: 1.0em Verdana, Arial, Sans-serif;
color: #444;
padding: 10px;
border: 1px solid #3182C0;
}
</style>
</head>
<body>
<div id="content">
<h1>ezRPG Installation</h1>
HEAD;
}
function displayFooter()
{
echo <<<FOOT
</div>
</body>
</html>
FOOT;
}
if (!isset($_GET['act']))
{
if (!is_writable('config.php') || !is_writable('smarty/templates_c'))
{
displayHeader();
echo '<h2>Step 1</h2>';
echo '<p>Please make sure the following files and folders are writable:';
echo '<strong>config.php</strong><br />';
echo '<strong>smarty/templates_c</strong><br />';
echo '<\p>';
echo '<p>';
echo 'The below folders are optional to make writable:<br />';
echo '<strong>lib/ext/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer</strong>';
echo '<strong>lib/ext/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer/HTML</strong>';
echo '<strong>lib/ext/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer/URI</strong>';
echo '</p>';
echo '<p>';
echo '<br />Chmod those files and folders to 0755 or 0777.</p>';
echo '<p><a href="install.php">Click here to check again</a></p>';
displayFooter();
exit;
}
else
{
displayHeader();
echo '<h2>Step 1</h2>';
echo '<p>You have given the files/folders the correct file permissions.</p>';
echo '<p><a href="install.php?act=2">Continue to next step</a></p>';
displayFooter();
exit;
}
}
else if ($_GET['act'] == '2')
{
displayHeader();
echo '<h2>Step 2</h2>';
if (!isset($_POST['submit']))
{
$dbhost = 'localhost';
$dbname = 'ezrpg';
$dbuser = '';
$dbpass = '';
$dbprefix = '';
}
else
{
$errors = 0;
$msg = '';
if (isset($_POST['dbhost']) && empty($_POST['dbhost']))
{
$errors = 1;
$msg .= 'You need to enter a host name!<br />';
}
if (isset($_POST['dbname']) && empty($_POST['dbname']))
{
$errors = 1;
$msg .= 'You need to enter a database name!<br />';
}
if (isset($_POST['dbuser']) && empty($_POST['dbuser']))
{
$errors = 1;
$msg .= 'You need to enter a database user!<br />';
}
//so far so good...
if ($errors == 0)
{
//let's test the connection
$db = mysql_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass']);
if (!$db)
{
$errors = 1;
$msg .= 'ezRPG could not connect to the database with the details you entered!<br />';
}
else
{
$db_selected = mysql_select_db($_POST['dbname']);
if (!$db_selected)
{
$errors = 1;
$msg .= 'ezRPG could not select the database with the database name you entered!<br />';
}
}
}
if ($errors == 0)
{
//No problesm connecting and selecting the database
//Save details to the config file and fill the database
$dbhost = $_POST['dbhost'];
$dbname = $_POST['dbname'];
$dbuser = $_POST['dbuser'];
$dbpass = $_POST['dbpass'];
$dbprefix = $_POST['dbprefix'];
//fill the database first
$query1 = <<<QUERY
CREATE TABLE IF NOT EXISTS `{$dbprefix}players` (
`id` int(11) unsigned NOT NULL auto_increment,
`username` varchar(30) default NULL,
`password` varchar(40) default NULL,
`email` varchar(255) default NULL,
`secret_key` text,
`rank` smallint(5) unsigned NOT NULL default '1',
`registered` int(11) unsigned default NULL,
`last_active` int(11) unsigned default '0',
`last_login` int(11) unsigned default '0',
`money` int(11) unsigned default '100',
`level` int(11) unsigned default '1',
`stat_points` int(11) unsigned default '10',
`exp` int(11) unsigned default '0',
`max_exp` int(11) unsigned default '10',
`hp` int(11) unsigned default '20',
`max_hp` int(11) unsigned default '20',
`energy` int(11) unsigned NOT NULL default '10',
`max_energy` int(11) unsigned NOT NULL default '10',
`strength` int(11) unsigned default '5',
`vitality` int(11) unsigned default '5',
`agility` int(11) unsigned default '5',
`dexterity` int(11) unsigned default '5',
`damage` int(11) unsigned default '0',
`kills` int(11) unsigned NOT NULL default '0',
`deaths` int(11) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
QUERY;
mysql_query($query1) or die('Something went wrong.');
$query2 = <<<QUERY
CREATE TABLE IF NOT EXISTS `{$dbprefix}player_log` (
`id` int(11) unsigned NOT NULL auto_increment,
`player` int(11) unsigned NOT NULL,
`time` int(11) unsigned NOT NULL,
`message` text NOT NULL,
`status` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `player_log` (`player`,`time`),
KEY `new_logs` (`player`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
QUERY;
mysql_query($query2) or die('Something went wrong.');
echo '<p>Tables installed.</p>';
//Save data to config file
$secret_key = createKey(24);
$config = <<<CONF
<?php
//This file cannot be viewed, it must be included
defined('IN_EZRPG') or exit;
/*
Title: Config
The most important settings for the game are set here.
*/
/*
Variables: Database Connection
Connection settings for the database.
\$config_server - Database server
\$config_dbname - Database name
\$config_username - Username to login to server with
\$config_password - Password to login to server with
\$config_driver - Contains the database driver to use to connect to the database.
*/
\$config_server = '{$dbhost}';
\$config_dbname = '{$dbname}';
\$config_username = '{$dbuser}';
\$config_password = '{$dbpass}';
\$config_driver = 'mysql';
/*
Constant:
This secret key is used in the hashing of player passwords and other important data.
Secret keys can be of any length, however longer keys are more effective.
This should only ever be set ONCE! Any changes to it will cause your game to break!
You should save a copy of the key on your computer, just in case the secret key is lost or accidentally changed,.
SECRET_KEY - A long string of random characters.
*/
define('SECRET_KEY', '{$secret_key}');
/*
Constants: Settings
Various settings used in ezRPG.
DB_PREFIX - Prefix to the table names
VERSION - Version of ezRPG
SHOW_ERRORS - Turn on to show PHP errors.
DEBUG_MODE - Turn on to show database errors and debug information.
*/
define('DB_PREFIX', '{$dbprefix}');
define('VERSION', '1.0');
define('SHOW_ERRORS', 0);
define('DEBUG_MODE', 0);
?>
CONF;
file_put_contents('config.php', $config);
echo '<p>Config file written.</p>';
echo '<p><a href="install.php?act=3">Continue to next step</a></p>';
displayFooter();
exit;
}
else
{
echo '<p><strong>Sorry, there were some problems:</strong><br />', $msg, '</p>';
$dbhost = $_POST['dbhost'];
$dbname = $_POST['dbname'];
$dbuser = $_POST['dbuser'];
$dbpass = $_POST['dbpass'];
$dbprefix = $_POST['dbprefix'];
}
}
echo '<p>Please fill in the database access details here.</p>';
echo '<form method="post" action="install.php?act=2">';
echo '<label>Host</label>';
echo '<input type="text" name="dbhost" value="', $dbhost, '" />';
echo '<label>Database Name</label>';
echo '<input type="text" name="dbname" value="', $dbname, '" />';
echo '<label>User</label>';
echo '<input type="text" name="dbuser" value="', $dbuser, '" />';
echo '<label>Password</label>';
echo '<input type="password" name="dbpass" value="', $dbpass, '" />';
echo '<label>Table Prefix (Optional)</label>';
echo '<input type="text" name="dbprefix" value="', $dbprefix, '" />';
echo '<p>You can enter a prefix for your table names if you like.<br />This can be useful if you will be sharing the database with other applications, or if you are running more than one ezRPG instance in a single database.</p>';
echo '<input type="submit" name="submit" value="Submit" class="button" />';
echo '</form>';
displayFooter();
exit;
}
else if ($_GET['act'] == '3')
{
displayHeader();
echo '<h1>Step 3</h1>';
if (isset($_POST['submit']))
{
$errors = 0;
$msg = '';
if (empty($_POST['username']) || empty($_POST['email']) || empty($_POST['password']) || empty($_POST['password']))
{
$errors = 1;
$msg .= 'You forgot to fill in something!';
}
if ($_POST['password'] != $_POST['password2'])
{
$errors = 1;
$msg .= 'You didn\'t verify your password correctly.';
}
if ($errors == 0)
{
include 'config.php';
mysql_connect($config_server, $config_username, $config_password);
mysql_select_db($config_dbname);
$secret_key = createKey(16);
$query = 'INSERT INTO `' . DB_PREFIX . 'players` (`username`, `password`, `email`, `secret_key`, `registered`, `rank`) VALUES(\'' . mysql_real_escape_string($_POST['username']) . '\', \'' . mysql_real_escape_string(sha1($secret_key . $_POST['password'] . SECRET_KEY)) . '\', \'' . mysql_real_escape_string($_POST['email']) . '\', \'' . mysql_real_escape_string($secret_key) . '\', ' . time() . ', 10)';
mysql_query($query);
echo '<p>Your admin account has been created! You may now login to the game. You can access the admin panel at <em>/admin</em>.</p>';
echo '<p><strong>Please delete install.php immediately!</strong></p>';
echo '<p><a href="index.php">Visit your ezRPG!</a></p>';
displayFooter();
exit;
}
else
{
echo '<p><strong>Sorry, there were some problems:</strong><br />', $msg, '</p>';
}
}
echo '<p>Create your admin account for ezRPG.</p>';
echo '<form method="post" action="install.php?act=3">';
echo '<label>Username</label>';
echo '<input type="text" name="username" value="', $_POST['username'], '" />';
echo '<label>Email</label>';
echo '<input type="text" name="email" value="', $_POST['email'], '" />';
echo '<label>Password</label>';
echo '<input type="password" name="password" />';
echo '<label>Verify Password</label>';
echo '<input type="password" name="password2" />';
echo '<br />';
echo '<input type="submit" value="Create" name="submit" class="button" />';
echo '</form>';
displayFooter();
exit;
}
?>
config.php(Of course I removed the password, because I'm posting it here)
<?php
//This file cannot be viewed, it must be included
defined('IN_EZRPG') or exit;
/*
Title: Config
The most important settings for the game are set here.
*/
/*
Variables: Database Connection
Connection settings for the database.
$config_server - http://legendofthesamurai.netau.net/
$config_dbname - a7875695_legend
$config_username - a7875695_admin
$config_password - youwishblahblahblah
$config_driver - mysql7.000webhost.com
*/
$config_server = 'mysql7.000webhost.com';
$config_dbname = 'a7875695_legend';
$config_username = 'a7875695_admin';
$config_password = 'youwishblahblahblah';
$config_driver = 'mysql7.000webhost.com';
/*
Constant:
This secret key is used in the hashing of player passwords and other important data.
Secret keys can be of any length, however longer keys are more effective.
This should only ever be set ONCE! Any changes to it will cause your game to break!
You should save a copy of the key on your computer, just in case the secret key is lost or accidentally changed,.
SECRET_KEY - A long string of random characters.
*/
define('SECRET_KEY', '692SdIZ3wVm?xzCod9r:zK]#');
/*
Constants: Settings
Various settings used in ezRPG.
DB_PREFIX - Prefix to the table names
VERSION - Version of ezRPG
SHOW_ERRORS - Turn on to show PHP errors.
DEBUG_MODE - Turn on to show database errors and debug information.
*/
define('DB_PREFIX', 'LegendofSamurai');
define('VERSION', '1.0');
define('SHOW_ERRORS', 0);
define('DEBUG_MODE', 0);
?>
#5
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 05 October 2012 - 07:44 PM
#6
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 05 October 2012 - 07:54 PM
Note- I could list everything, but I will just list the jist of everything.
Quote
System- Linux srv27.000webhost.com 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64
apache2handler
Apache API Version 20051115
mysql
Client API version 5.1.57
Here is the link to the complete list the server uses, not sure if you can access it.
http://server27.000w...com/phpinfo.php
#7
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 05 October 2012 - 08:03 PM
#8
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 05 October 2012 - 08:10 PM
modi123_1, on 05 October 2012 - 08:03 PM, said:
The host site works just fine, unless you are referring to the ezRPG website; then you would be correct. As for the code I don't know why it doesn't work and it seems you can't figure it out either. Perhaps you could point me into the right direction? As I would very much enjoy crafting my own persistent browser-based RPG game. Though I would prefer a template of some sort, I do not really want to draft up every single bit of code.
#9
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 05 October 2012 - 10:04 PM
Quote
Yes.. because of the lack of information presented and not having the 'hands on'-ness of working with the server directly. How about you talk to the people that made the software. I would wager they might know a bit more about how to install it right than folk who never have heard of it.
#10
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 05 October 2012 - 10:24 PM
So as for your comment about lack of information provided is a bit rash, I'd have to say. I came here looking for help, not a hand out. I am more than willing to put forth the effort; I just need a leg-up.
#11
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 06 October 2012 - 01:24 AM
You are fixated on a chunk of code that isn't working and is not being supported.
This is the time you need to take an earnest look and reevaluate what you are using. I don't have the time, nor inclination, to try and install this on a VM tonight. What I do suggest is going back to the well and finding an alternative and keep moving forward.
#12
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 06 October 2012 - 05:34 AM
#13
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 06 October 2012 - 09:11 AM
ShibataTim, on 05 October 2012 - 08:10 PM, said:
ShibataTim, on 05 October 2012 - 10:24 PM, said:
#14
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 06 October 2012 - 01:00 PM
#15
Re: Error 404 with php game, but the page is there (ezRPG)
Posted 06 October 2012 - 03:42 PM
|
|

New Topic/Question
Reply



MultiQuote








|