PDA

View Full Version : [FAQ] Developing locally on your own local PHP/MySQL/Apache server



mdshare
08-16-2006, 02:26 PM
Developing Mods locally on your own local PHP/MySQL/Apache server

Its easier than you might think!

I setup a dedicated local server once to let me do this but it turns out there is an even faster easier way to do it .

http://www.wampserver.com

wampserver is a complete software package allowing to use all the power and the flexibility that offers the dynamic language PHP and the effecient use of databases under Windows. Package includes an Apache server, a MySQL database, a fully PHP execution, as well as easy development tools for your web site or your applications.

Best part - its a one click install on your local system no need anymore to upload your scripts to a server, you can test them on your own PC.

And don't be afraid to experiment with php it's a very easy language to learn

As php/htm/whatever language editor I use Crimson Editor which is also free available at http://www.crimsoneditor.com/

md

Arson
08-18-2006, 08:56 PM
The link to the english version of WAMP Server is www.wampserver.com/en/ (http://www.wampserver.com/en/)

bored292
08-18-2006, 10:44 PM
hm does it have anything in it to do the cron job things?

mdshare
08-18-2006, 10:54 PM
you can ad extra's and php libraries just like on a real server, don't forget to edit the php.ini

but honestly I never used crons with it, just for testing localy before uploadin as I hate online editing of scripts.

Arson
08-19-2006, 12:05 AM
Cron jobs as far as I know are not a possibility with Wampserver. I have used wampserve for quite a while and made several posts on their support forums. No real helpful replies came from that.

The only thing wampserver is really for is to make sure all your scripts run decently before uploading them to the server for the first time. If you want your energy to refil you will have to make a cron script and execute it yourself whenever you want to gain more energy. Since its offline, I reccomend making the cron completely refill everything on you. Here:


mysql_query("update users set energy=maxenergy, hp=maxhp, brave=maxbrave, will=maxwill",$c);

that query will give u full energy and you can just put it n the headers.php file if you want your energy brave will and health to stay full no matter what.[/code]

Darkwolf
08-19-2006, 02:42 AM
Im considering looking at the www.wampserver.com/en/ (http://www.wampserver.com/en/) program, but first, can anyone tell me roughly thier experiences with it? what kind of system specs do i have to look at for it? work best with linux or windows?

bored292
08-19-2006, 08:32 AM
i got it running on a crappy winxp machine and it working perfectly :)

not had no problems with it at all quite simple really :D

mdshare
08-19-2006, 08:57 AM
what I personally like is that you can switch with 1 click to a diff php version. So if you code in php5 you can test your script if it will run under php4

Decepti0n
08-19-2006, 09:17 AM
It took me about 3 months to set up php, mysql and apache on my machine manually...well not three months straight but still

i found it in a book, and it was still kinda mashed together, but it works for me and it was a good learning experience lol

arcteller
09-08-2006, 01:26 AM
I'd suggest trying XAMPP ..

http://www.apachefriends.org/en/xampp.html

Includes web server, mySQL and PHP 5.. quick and stimple all in one shot. Works fine for me.

Had to use a third party app for Cron Jobs, but other than that, it was all in one install.

bored292
09-08-2006, 08:43 AM
arcteller

can you tell me what product you are using for cron job's please?

ty

arcteller
09-08-2006, 09:58 AM
I'm using Automate 6. Is overkill for the task. Buts its what I eventually got to work for me..

bored292
09-08-2006, 02:03 PM
hm i have had alook at that now and it don't look very good for the tasks i need it too do ^^

Snatchy
12-14-2006, 04:51 PM
what in the php.ini am i supposed to edit?

Decepti0n
01-30-2007, 02:38 PM
after months of working with a hand-made apache installation :p i finally d/led wamp

i love it, i loaded the zip, curl, imap and gd extensions in about ten clicks :D as opposed to my nights of getting it to work before

kinda irritating moving all my files over but its ok....now i can mess around with other extensions (specifically zip because im bored)

CraigF
02-11-2007, 11:55 AM
ill do it when im on my computer, it sounds good =D

chaoswar4u
03-26-2007, 05:32 AM
Im currently using WAMP and as of which currently host my game. As under windows to do crons I use a program called VisualCron which isnt that hard to set up and works 100% for me. Never had a cron problem yet. Needless to say I host my game myself using this setup as of which runs at great speed.

mshaeffer
04-01-2007, 05:04 AM
I downloaded WAMP to mess around with the orignal v1.1 code I purchased but I cant seem to log in to the game now. I installed the orignal code and the orignal sql_schema and when I try and log in using admin:admin I get this error:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\authenticate.php on line 12

Can someone help me?

vinyl
04-01-2007, 05:21 AM
does mysql.php have your database info,name,pass,location correctly entered?

mshaeffer
04-01-2007, 05:26 AM
as far as I can tell it does

vinyl
04-01-2007, 05:36 AM
well, IF you are using an unmodified authenticate.php script...
AND if you don't get an error like "You did not fill in the login form!"
THEN you have POST'ed the name and pass as something other than "" or ""

I still suspect the mysql.php info, but I make mistakes everyday.
the script only has the ONE query.

vinyl
04-01-2007, 05:45 AM
otherwise you may want to paste the query and the following IF NUM_ROWS statements here to be viewed and considered.

Jake
04-04-2007, 10:25 PM
I installed this, and it never loads up. It says im using version 0.0.0.0 And every time i click the icon, it starts the installer. And when i go through the start menu, nothing happens

N00b
04-07-2007, 11:18 PM
can u build your own servers their? :s

Mambug
04-11-2007, 11:53 PM
I still prefer manually installing these.

It took me 2-3 hours my first time to manually install Apache, PHP + MySQL successfully.

twist_killer
04-12-2007, 08:32 PM
err i installed it and started it....the screen comes up for 2 seconds then then goes off....then nothing happens!

hamster01
04-12-2007, 10:35 PM
i Still have an phpmyadmin error on my wamp :lol:

Mambug
04-12-2007, 11:25 PM
i Still have an phpmyadmin error on my wamp :lol:


Your using PHPMyAdmin on a windows system? No - Don't. It's a great web interface utility however when you have access to much better, use the "much better" choice... http://dev.mysql.com/downloads/gui-tools/5.0.html

Decepti0n
04-12-2007, 11:35 PM
I use PMA on Windows :(

twist_killer
04-13-2007, 11:23 AM
can anyone help me and jake plz? we seem to have the same problem

mikey1090
04-15-2007, 10:01 AM
hm does it have anything in it to do the cron job things?


cronjobs can only be ran from linux/unix machines, not windows!

mdshare
04-24-2007, 06:27 PM
that's new to me, since when does it not exist

You can easily setup cron from Plesk >> Domains > domain name > Task scheduler > on a windows server

see the >>>> task scheduler <<<< that is the equivalent of the cronjobs on linux/unix servers if not installed on plesk you may need to install a 3rd party scheduling software which is easy found but very doubtfull it isn't installed.

richard101
05-10-2007, 12:37 AM
Developing Mods locally on your own local PHP/MySQL/Apache server

Its easier than you might think!

I setup a dedicated local server once to let me do this but it turns out there is an even faster easier way to do it .

http://www.wampserver.com

wampserver is a complete software package allowing to use all the power and the flexibility that offers the dynamic language PHP and the effecient use of databases under Windows. Package includes an Apache server, a MySQL database, a fully PHP execution, as well as easy development tools for your web site or your applications.

Best part - its a one click install on your local system no need anymore to upload your scripts to a server, you can test them on your own PC.

And don't be afraid to experiment with php it's a very easy language to learn

As php/htm/whatever language editor I use Crimson Editor which is also free available at http://www.crimsoneditor.com/

md


OK im new to this so please can you help me i downloaded crimsoneditor now what do i do i want to create an rpg how do i write the script and how do i create the game? And i cant understand wampserver its on another language.

hamster01
05-10-2007, 10:35 AM
Well..
I don't use wamp, i put it on linux, thus i dont know wamp.
To make an rpg is fairly hard, depending on the type your making.
You will need some(more than 6 months) expierance with php, mysql.

Oh and un-like above, php isnt very easy to learn.
Strings: Yes, thats the easy part ;)

Floydian
01-31-2008, 05:32 PM
OK im new to this so please can you help me i downloaded crimsoneditor now what do i do i want to create an rpg how do i write the script and how do i create the game? And i cant understand wampserver its on another language.


Perhaps you should try your hand at making some mods first?

Or even better, just make up some scripts on your own. My suggestion for your first script, since you seem to wanna jump right in, is a login, logout script.

If you can make that work, then do an account creation script, and move on from there.

If you can't do that, you'll want to seriously think about coding your own game and have someone do it for you.

funnybone
02-14-2008, 11:03 AM
hi there

firstly this is my first post, total noob so please be gentle :-D

i am battling to install mccodes on a local server (Ravenswood-JS-1.0.12.1) i am using this since i use it to do my joomla template designs in and it is basically the same as xlammp etc.

Below is the error message that i get
1. Diagnostics >> 2. Configuration >> 3. Installation & Extras
Basic Diagnostic Results:
PHP version >= 4.2.0 OK
Game folder writable OK
MySQL support in PHP present OK
Game installed at root level of domain or subdomain Failed
One of the basic diagnostics failed, so Setup cannot continue. Please fix the ones that failed and try again.

Now i have no knowledge of php except for joomla template configs :oops: and only want to install mccodes to see what it is capable of before maybe buying v2.

Steps done so far :
1. phpadmin created blank database ( test)
2. sql db imported into above database
3. opened installer.php
4. got error message
5. googled trying to install code on local server
6. found your forum
7. been sitting around here swearing at my p.c and damaging my own self confidence
8. got revenge playing bf2 shooting peeps while shouting damm you .php :lol:

any advice or pointers would be appriciated, and yes total nOOB so no need to remind me. :)

mdshare
02-14-2008, 11:23 AM
do you have a download from the right source ?

If not, it could be that it was alterd code...

http://www.dabomstew.com/codes-lite-v101-gnu.zip is the original lite code.

funnybone
02-14-2008, 11:35 AM
ok i have downloaded from your link, will retry from your source and see what happens

holding thumbs that it works, thanks for your prompt non flaming reply :)

funnybone
02-14-2008, 12:05 PM
MC Codes Installation
1. Config -> 2. Install
Warning: mysql_connect(): Access denied for user: 'admin@localhost' (Using password: YES) in W:\www\joomla\installer.php on line 66
INSTALLATION ERROR: Access denied for user: 'admin@localhost' (Using password: YES)
> Back

steps taken created blank database test ( deleted the previous one ) installed db got to installer.php and entered following details:

Database Details:
MySQL Hostname: localhost
If unsure, localhost is the default on most servers
MySQL Username: root
MySQL Password: root
MySQL Database: test
Please make sure the user has access to the database.
Admin Details
Admin Username: admin
Admin Password: admin
Confirm Password: admin
Admin Email Address: admin@admin.com

i then get the error message, so maybe i need to edit config.php ( whats needed in joomla), but i cannot find a config.php file

maybe i am ( well probably) being stupid and am missing something here, if so please hit me against the head call me stupid and then help me :-D

I know that I am asking for alot of hand holding but i seem to have hit a mental block to trying to figure this out, and my only point of reference is how i install joomla ( maybe this is the root of my problem)

Thanks in advance

ok tried something else deleted test db created new one called mccode went to mysql.php and saw the following:
<?php
$c = mysql_connect('localhost', 'root', 'root');
mysql_select_db('mccode', $c);
$mykey=1513619456;
?>

now i get this error ( glad its not the same as previous but not sure if i am making progress), I live in South Africa and there are no posts about mccode, so thanks for the help so far.

MCCodes Installation
1. Config -> 2. InstallWrote mysql.php file...
INSTALLATION ERROR: Table 'adminlogs' already exists
> Back

funnybone
02-14-2008, 12:41 PM
I realize that my posts are long, but i am really trying to do a step by step so that hopefully this will be of help to other noobs once I/We have figured it out.

Now i am wondering if I must fill in these details in installer.php ?

print "Database Details:

<form action='installer.php?step=install' method='post'>
<table width='70%' border='1'>
<tr>
<td>MySQL Hostname:

If unsure, localhost is the default on most servers</td>
<td><input type='text' name='dbHostName' /></td>
</tr>
<tr>
<td>MySQL Username:</td>
<td><input type='text' name='dbUserName' /></td>
</tr>
<tr>
<td>MySQL Password:</td>
<td><input type='password' name='dbPassword' /></td>
</tr>
<tr>
<td>MySQL Database:

Please make sure the user has access to the database.</td>
<td><input type='text' name='dbDatabase' /></td>
</tr>
</table>
<hr />
Admin Details

<table width='70%' border='1'>
<tr>
<td>Admin Username:</td>
<td><input type='text' name='adUsername' /></td>
</tr>
<tr>
<td>Admin Password:</td>
<td><input type='password' name='adPassword' /></td>
</tr>
<tr>
<td>Confirm Password:</td>
<td><input type='password' name='adCPassword' /></td>
</tr>
<tr>
<td>Admin Email Address:</td>
<td><input type='text' name='adEmail' /></td>
</tr>
</table>
<input type='submit' value='Install' />
</form>";

I am going to try this and see what happens, hope i am not flooding this topic

edit: that did nothing but give me the same error message:
MCCodes Installation
1. Config -> 2. InstallWrote mysql.php file...
INSTALLATION ERROR: Table 'adminlogs' already exists
> Back

so i am now going to delete adminlogs via cpanel and see what happens, if nothing new happens i will go play some bf2 and wait for some expert help

deleted adminlogs, opened installer.php - filled in the details and...

MCCodes Installation
1. Config -> 2. InstallERROR: You did not fill in one or more elements of the form. Please go back and try again.

so i give up for now, beaten but not crushed

mdshare
02-14-2008, 01:23 PM
start with a clean database (no tables) the installer will populate the database

funnybone
02-14-2008, 02:13 PM
dude it cannot be that easy can it :? :?

lol i will try that then if it works i will smash my head against the wall repeatetly

mdshare
02-14-2008, 02:16 PM
well in theory it should be so easy

funnybone
02-14-2008, 02:24 PM
omg it gave me same error and then i remembered :oops: :oops: :oops: :oops: the joomla local server has database username and password set to root

after i remembered that it worked as you said.

thank you thank you :) :)

shadownexusruler
04-13-2008, 06:41 PM
xampp don't work on vista premium it's only compatible with vista ultimate i tried xampp on vista home premium and all i get is errors after installing to my desktop

Spudinski
04-14-2008, 01:59 PM
xampp don't work on vista premium it's only compatible with vista ultimate i tried xampp on vista home premium and all i get is errors after installing to my desktop

What are the errors, normally it is supported across all distributions of the OS.
It might be a simple problem like an incorrectly configured startup script or config file.

shadownexusruler
04-15-2008, 03:06 PM
the installation went fine it's that when i go to set up mysql i get a libmysql.dll error

Floydian
04-15-2008, 03:42 PM
You can get a copy of that file from the PHP site.

http://us2.php.net/manual/en/mysql.installation.php

That link should help you reinstall that file.
Editing the php.ini file may be required. You'll certainly need to check and make sure the extension is enabled there.

Tonka
04-25-2008, 01:46 AM
if you are running a windows box, just use WAMP (Windows, Apache, mySQL, PHP) http://www.wampserver.com/en/index.php all the programs are configured to work with each other

jamboy1
06-20-2008, 04:39 AM
MC Codes Installation
1. Config -> 2. Install
Warning: mysql_connect(): Access denied for user: 'admin@localhost' (Using password: YES) in W:\www\joomla\installer.php on line 66
INSTALLATION ERROR: Access denied for user: 'admin@localhost' (Using password: YES)
> Back

steps taken created blank database test ( deleted the previous one ) installed db got to installer.php and entered following details:

Database Details:
MySQL Hostname: localhost
If unsure, localhost is the default on most servers
MySQL Username: root
MySQL Password: root
MySQL Database: test
Please make sure the user has access to the database.
Admin Details
Admin Username: admin
Admin Password: admin
Confirm Password: admin
Admin Email Address: admin@admin.com

i then get the error message, so maybe i need to edit config.php ( whats needed in joomla), but i cannot find a config.php file

maybe i am ( well probably) being stupid and am missing something here, if so please hit me against the head call me stupid and then help me :-D

I know that I am asking for alot of hand holding but i seem to have hit a mental block to trying to figure this out, and my only point of reference is how i install joomla ( maybe this is the root of my problem)

Thanks in advance

ok tried something else deleted test db created new one called mccode went to mysql.php and saw the following:
<?php
$c = mysql_connect('localhost', 'root', 'root');
mysql_select_db('mccode', $c);
$mykey=1513619456;
?>

now i get this error ( glad its not the same as previous but not sure if i am making progress), I live in South Africa and there are no posts about mccode, so thanks for the help so far.

MCCodes Installation
1. Config -> 2. InstallWrote mysql.php file...
INSTALLATION ERROR: Table 'adminlogs' already exists
> Back


You've done almost everything right, the only problem now is that you have tables already existing, once you have created a DB don't add anything to it, just run installer.php and fill exactly how you did then, copy the crons, put them into the Cron Jobs, and you should be up and running in no time at all :)