Testing PHP/MySql without a server?
Moderator: General Moderators
Testing PHP/MySql without a server?
Hello,
I recently got dreamweaver cs5 and was wondering if its possible to test php/mysql within the program without having a server?
If this is not possible, where is the cheapest place for servers? I won't be using much space just practicing.
I recently got dreamweaver cs5 and was wondering if its possible to test php/mysql within the program without having a server?
If this is not possible, where is the cheapest place for servers? I won't be using much space just practicing.
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: Testing PHP/MySql without a server?
If you mean that you don't want to purchase hosting then perhaps you should look at a package like Xampp which, simply put, will allow you to test out code and run web apps on your local machine.
Other similar packages also exist, depending on your personal preference and what sort of OS you are running.
Wamp
Mamp
EasyPHP
You could also get hold of and install individual parts of the stack separately.
Other similar packages also exist, depending on your personal preference and what sort of OS you are running.
Wamp
Mamp
EasyPHP
You could also get hold of and install individual parts of the stack separately.
Re: Testing PHP/MySql without a server?
PHP and MySQL servers are necessary; however, expense is not. Web programmers typically install an HTTP server (Apache, IIS, etc.) on a local machine along with a database server (MySQL, etc.). Together, that locally-installed software makes up the development environment. When the developed application is ready for public use, it is uploaded to a production environment.
It is possible to create a development environment with no-cost software. As greyhoundcode mentioned, the quickest and easiest way to set up a server is to install a bundle like XAMPP. If the HTTP server lives on the same machine as your browser, it is known to your browser as "http://localhost/" or "http://127.0.0.1/".
It is possible to create a development environment with no-cost software. As greyhoundcode mentioned, the quickest and easiest way to set up a server is to install a bundle like XAMPP. If the HTTP server lives on the same machine as your browser, it is known to your browser as "http://localhost/" or "http://127.0.0.1/".
Re: Testing PHP/MySql without a server?
I've installed Apache 2.2 and my server is running fine.
Only problem is that some of the php commands do not work, echo for example is fine but getting information from a text file does not want to work.. Im trying to create a listing system that basically has all my possessions and once someone borrows one of my items, I can change it to "Lent out" while giving it a time limit too, so in 2 weeks time I'll either email them or send an SMS text message.
Thanks for the recommendations.
Only problem is that some of the php commands do not work, echo for example is fine but getting information from a text file does not want to work.. Im trying to create a listing system that basically has all my possessions and once someone borrows one of my items, I can change it to "Lent out" while giving it a time limit too, so in 2 weeks time I'll either email them or send an SMS text message.
Thanks for the recommendations.
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Testing PHP/MySql without a server?
What do you mean "does not want to work"? Do you get an error? Do you have errors enabled? If you don't, you should. A development environment should always have errors enabled.
http://nucleussystems.com/blog/enable-error-reporting
http://nucleussystems.com/blog/enable-error-reporting
Re: Testing PHP/MySql without a server?
If you want help with a particular script, please post the code. Also state where the files are located.
You may be better off using a database instead of a text file.
You may be better off using a database instead of a text file.
Re: Testing PHP/MySql without a server?
Code: Select all
<?
$data=file_get_contents('list.txt');
$dat=explode("\r\n",$data);
echo '<table border=1 cellpadding=3 cellspacing=0>';
foreach ($dat AS $val) {
echo '<tr><td>'.$val.'</td></tr>';
}echo '</table>';
?>When I load the php file all it shows is
Code: Select all
}echo '</table>';?>- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Testing PHP/MySql without a server?
That means that PHP isn't being executed. Try using full <?php ?> tags instead of the short <? ?> tags. That's a best practice anyway.
Re: Testing PHP/MySql without a server?
I tried it, but to no such luck.
Its definitely not recognising PHP anymore, it was working fine a few weeks back but it's packed up and I have no idea how to fix it... : /
Definitely need a server thats reliable and not installed by myself :DD
Its definitely not recognising PHP anymore, it was working fine a few weeks back but it's packed up and I have no idea how to fix it... : /
Definitely need a server thats reliable and not installed by myself :DD
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Testing PHP/MySql without a server?
How are you running the file i.e http://localhost/your_file.php ? Paste the following into a file name file.php then execute it (and report your results
)
Hth
Hth
Code: Select all
<?php phpinfo(); ?>
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering