Is there a tool or extension for a browser to working with PHP offline? I read about you need to install an Apache server.
Is there an easier way to view offline in browser to see how the PHP code executes?
XAMPP sets up a local install of MySQL, PHP, and Apache that you can develop on.
In Windows, install XAMPP or WAMP
Which are Windows Apache Mysql and Php bundles
In Linux install LAMP
Which is a Linux Apache Mysql and Php bundle
Both of which could help
Nope, simpler than xampp is not possible.
This won't be much use to you now, but there has been recent talk (and submission of code) of providing a built-in web server into PHP itself.
See the RFC at https://wiki.php.net/rfc/builtinwebserver
You could then write your script (e.g. app.php), execute php -S localhost:8000 to start the web server and then see the results in your browser at http://localhost:8000/app.php.
In the mean time, you can install Apache/PHP/MySQL/etc. on your local box, as the other answers have suggested, either manually or with a package like XAMPP.
No. PHP code must be processed by a PHP engine, and the easiest way to do so in a web environment is to use a web server. It does not need to be httpd, but it must be something.
if you are on a Mac, you have Apache installed already. the additional instructions you will need to add PHP and MySQL database server can be found here http://www.entropy.ch/software/macosx/
if you are using Windows, XAMPP is a self contained Apache/MySQL/PHP environment that runs as a stand alone application.
that should get you started. good luck
Related
I am returning to php after a long time (although I have a very basic understanding of php in general), and understand that I can run a php server locally by running the command now with version 5.6:
php -S localhost:8080
Do I still need to install XAMP or WAMP as many of the online tutorials are suggesting or am I okay to just use the above command?
Note: I have postgresql installed on my computer already and do not use mysql, if that matters at all
You need a webserver which you prefer depends on you. XAMPP is the most used for private but you could also take a look at BigApache, EasyPHP, PHPTriad, MampServer, WampServer.
Xampp is a combination of below
Apache server
Mysql server
PHP
and others.
This is a pretty famous and most used package. But if you want to install everything manually then thats even better you can control your server in any way you want. Go for it and you will learn more about it.
If you want a very flexible development environment you need to use a package like EasyPHP Devserver (http://www.easyphp.org/) or equivalent.
The situation is simple: I have a PHP file and I want to serve it on my localhost. I already have MySQL set up and don't want to install XAMPP or other bulky packages which come with their own MySQL or any other thing such as that.
I tried many Node.js ways to serve a PHP file but none worked for me.
Please, I just have a file and want to "run" it. How can I do that?
Unfortunately, if you want to run a "server-side" code (in your case PHP) in your Windows computer, you have to use a web server that simulate for you it.
XAMPP (or WAMP) enables localhost port to receive connections from yourself and it is a smart way to try in "local" your code.
If you want to run PHP but you don't want to install XAMPP, then you can install a linux distribution and run "apache HTTP server" that is already installed in most distributions. But in every case you need a tool to simulate the "server-side" part.
First of all nodeJS means nodeJavaScript. So it will not support php with mystery magical things.
You could only install Apache server and mySQL. Then you donĀ“t need any XAMPP and the tools it brings with it.
Try to install Apache standalone.
Not sure if this works but should be no problem.
But all in all i would recommend you to use XAMPP
I don't have anything extra installed on my computer. Whenever I try to include one local PHP file on another, nothing happens. My question is if it should be working, or if I have to have some kind of server for it to work?
Well, you obviously need a server for a server side language... Don't you think?
Have a look at PHP servers such as Apache, or install an all-in-one such as XAMPP or WAMP.
At the very least, you need to install PHP and run it from the command line.
Iam not able to get familiar with XAMPP interface on Windows7 (Only prior experiencxe is with HTML,C,C++).
How to proceed to begin development work in PHP and MySQL and test developed contents using Apache Server.
Please help to understand its working flow.
Thanks in Advance.
First, find a good PHP book or tutorial to learn PHP. There are plenty out there, just Google or visit the PHP homepage.
As you follow the book or tutorial, save your .php files in the XAMPP htdocs folder. This will let you view your results using the XAMPP web server. For example, if you write a PHP script called test.php and save it in the htdocs folder, you can access it on your local XAMPP server via http://localhost/test.php.
XAMPP includes phpMyAdmin, which lets you manage the included MySQL database. You can learn more about phpMyAdmin here.
Be sure to read the XAMPP documentation so that you know how to start up Apache and MySQL and access phpMyAdmin.
XAMPP is only a service that provides a webserver, server side language (PHP), database and interface to connect to said interface. Once it is installed you are good to go, all you need to do is turn on Apache, then MySQL. All the rest of the installation requirements should be done automatically upon installation.
Maybe it is better to explain your particular issue...
I was beginning from Denwer. It was very easy to begin with him. He includes php, mysql, apache.
http://www.denwer.ru
You have to run the Apache server for php and the MySQL server for MySQL :D. You can run it by starting the XAMPP Control and than run them. Now you can go to the localhost http://localhost/
There are some instructions.
I hope it is useful.
Marcel
Do you really need XAMPP? Sumit, I also have Win7/x64 on one machine, where I installed
Apache 2.2.16 for 32bit Windows
PHP 5.3.2 (x32 Windows VC6 install binary)
Perl 5.12.1 32bit x86 from Activestate
MySQL 5.1 32bit x86 Windows installer)
I installed all-32-bit stuff (even if on 64bit Windows) because that guarantees you a much simpler life. You can handle or maintain every component individually, for including PHP or Perl into Apache, you just change a line or two in the Apache config file. There's no magic at all with all these programs. Install them by yourself and learn a lot in the process.
I want to do a sample program in PHP on Windows XP.
Do I need any special software to get this to work?
I am afraid that I simply open notepad type the PHP program and save it with php extension. Then I open it with the browser as a HTML file. But it does not work.
Please help
Thanks in advance
However you decide to install a webserver and php (or just php and use it in the console like someone mentioned):
Check out the PHP Manual, especially the Getting Started section.
Apache (Very, very easy)
Check out the WampServer getting started presentation.
Download and install WampServer.
And you are ready to go.
Microsoft (Not tested this myself)
Check out PHP on Windows.
Download and install the Microsoft Web Platform Installer.
Let me know how that work out... (never tried it myself, since WampServer is so easy)
You need to have a web server with PHP installed on your PC to make this work.
I highly recommend installing wampserver on your computer. It is a Windows installer that will put PHP, MySQL and Apache in your computer and let you manage all the services and such very easily. If you have problems getting it to work, you can also try out XAMPP, although I've never used it myself.
Some answers containing the hint for using wamp.
You should better use the Zend Server Community Edition.
This is also free and can be downloaded here:
http://www.zend.com/de/community/zend-server-ce
This contains Apache, Mysql, PHP and some Zend related Tools.
Benefit: its much better preconfigured than wamp.
Another easy one to set up (though it takes extra config to support PHP5) is easyPHP
you can simply install PHP, and then run the program and redirect the output
php foo.php > output.html
and then use any browser to open up that html file.
Since you have IIS on the windows cd I would suggest you go to control panel, install/uninstall programs and click on windows components and install IIS. Then install ASP.NET 3.5 from www.asp.net and finally install Phalanger from http://www.php-compiler.net/
That will give you the benefit of both worlds, you can program in ASP.NET using PHP as the language, you can use only PHP if you prefer that or you can mix using ASP.NET/C# on some pages and PHP on other pages within the same application.
I use XAMPP, works out of the box with his installer and is more than enough for a simple developer windows environment.
The simplest way - use www.microsoft.com/web platform installer. get the whole stack to run PHP all from one place.
i would like to share that before starting PHP we have to set environment for that and then we can start working with PHP.
http://code.freefeast.info/php-tutorials/setting-up-the-environment-for-php-php-tutorial/