![]() Hopefully this simple tutorial helped you with your development. Open a browser and type in You can now check out pChart's awesome demo.Īre you ready to make use of PHP built-in web server? How about using it to run our resumble file uploader? Have fun! #The end Step 3: Start the server cd pChart2.1.4 / examples / php - S localhost : 8888 Step 2: Extract zip/tar file tar - xzf pChart2.1.4. Step 1: Download pChart curl - LOk http : //We are using a Mac and comfortable with doing things with Terminal. Brief information about pChart, it is a server-side charting library. We will show you how easy and fast to setup pChart examples on our local machine. ![]() To demonstrate how we can have fun with PHP built-in web server. #Running pChart in PHP built-in web server It is perfect for development and testing purpose. You can do so easily by supplying the router file additionally.Īs you can see, PHP built-in web server is an easy to use web server, which does not come in with complicated configurations. In some situation, you might want to use some third party router to serve the request. Using router file php - S localhost : 8000 router. In the example above, request will be served from foo directory. The -t option allows us to specify a document root directory. Specifying a document root directory php - S localhost : 8000 - t foo / You will be able to visit the site via URL localhost:8000 as the URL from any browser. It will treat current directory as the document root directory and if a request does not specify a file, then either index.php or index.html in the given directory are served. Starting a server php - S localhost : 8000 In this section, we will go through a couple of simple commands for PHP web server. You can apply the same techniques when you ever want to test out something. ![]() In section 3 of this tutorial, we take advantage of PHP built-in web server to run examples of pChart. It saves us from installing any real server or other third party tools. However, as it comes with PHP, it is super handy when we need to spin up a web server to do some testing or development. It is not a full-featured web server, so we should not use it for production. This web server was designed to aid application development. The answer is as stated in PHP official page. The first question comes to mind when PHP 5.4 introduced built-in web server is, why do we need a PHP built-in server when we already have Apache/Nginx? And we also have some nicely packaged tools such as WAMP and XAMPP. And show you how we can actually take advantage of this simple web server to do some fun stuff. ![]() In this tutorial, we will teach you how to use PHP built-in web server. If you haven't heard yet, you should probably know starting from PHP 5.4, PHP has a built-in web server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |