hi everyone,
say i have a php code that works fine. How would i test it? can i use tomcat server to run the code or there is another way?
ps im new to php :p
thank you
Quick, practical ways to run and test PHP locally (building on points from and ).
If you want the fastest, least-fiddly start, use a prepackaged dev stack that installs Apache, PHP and a DB in one step. Popular choices are XAMPP, WampServer (Windows) or MAMP (Mac). Typical workflow: install the package, run its control panel to start Apache, put your PHP files into the server document root (for XAMPP that is htdocs), then open the page in a browser at http://localhost/yourfile.php. These packages also include phpMyAdmin and bundled PHP versions so you can confirm everything works without manually wiring modules.
If you prefer minimal or command-line workflows, the PHP runtime includes a built-in development server you can start from your project folder (good for quick tests, not production). From a terminal run the server and browse to the given localhost address. This is handy if you do not want to install a full stack.
About Tomcat: Tomcat is a Java servlet container and does not run PHP natively. There are bridges (or Java implementations of PHP such as Quercus) but they add complexity and can behave differently than standard PHP. For learning or general web development it is simpler and more reliable to use a server that directly supports PHP (Apache, nginx with php-fpm, or IIS with FastCGI).
For : modern Windows lets you add IIS via Control Panel -> Programs and Features -> Turn Windows features on or off (it will pull components from the OS or Windows Update). If you cannot use the Windows components path, Microsoft provides IIS Express as a standalone development server. Common troubleshooting tips for everyone: ensure files use .php, check server error logs, verify the PHP module/FastCGI is enabled, restart the server after config changes, and watch for port conflicts (Skype, etc.).
Jump to Post— paradox814 1tomcat is typically used with Java Servlets not PHP, besides opening the file in a browser how else are you supposed to test it?
I don't know, you'll have to explain your situation a little more
here is a verry simple php file:
<? phpinfo(); …
tomcat is typically used with Java Servlets not PHP, besides opening the file in a browser how else are you supposed to test it?
I don't know, you'll have to explain your situation a little more
here is a verry simple php file:
<? phpinfo(); ?> when you run that and you get a lot of PHP info then you will know PHP is working on your server
Paradox, his question is clear enough I think. His point is that you can't simply double-click a PHP file on your local disk and expect it to pop open and run in the browser---like you would an HTML page.
Sam, you are on the right track--you can only test PHP against a webserver configured to process PHP. The defacto standard web server for use with PHP is Apache. However, IIS works fine, too. I don't know about Tomcat.
My recommendation is to install Apache and PHP on your local workstation and use that. The process is not too difficult, but not exactly intuitive to the first-timer either! I have a slightly dated WAMP HOWTO that should get you where you need to be.
http://www.troywolf.com/articles/wamp_howto.htm
If you want to use a Linux server to test against instead of Windows, then look for a LAMP guide. Actually, most Linux flavors come with Apache ready to process PHP, so it could be as simple as starting your Apache process and plopping your PHP files into the webroot dir.
thank you guys!!!
hey, i'm new to php too. i'm even worse off. the question i have is:
is there a way to install the IIS on your pc without the microsoft service cd if you use windows?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.