News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Master Zend Framework:
Running the ZF2Skeleton with PHP's Built-in Webserver
April 24, 2014 @ 09:25:07

The Master Zend Framework site has posted the first in their screencast series with a look at running the ZF2Skeleton with PHP's built-in webserver.

In this screencast we'll go through the creating an application from the ZF2Skeleton project on Github and getting it up and running, using PHP's built-in web server. [It requires] PHP 5.4 or higher and Curl.

The screencast, coming in just over 3 minutes, briefly introduces you to the ZF2Skeleton project and shows you how to run it as a single process though PHP's own web server (useful for debugging). As a part of the installation, he also helps you get Composer installed as that's what Zend Framework 2 uses to install its packages correctly.

0 comments voice your opinion now!
screencast tutorial webserver builtin zf2skeleton

Link: http://www.masterzendframework.com/casts/001

Gonzalo Ayuso:
How to run a Web Server from a PHP application
November 11, 2013 @ 11:53:06

Gonzalo Ayuso has put together a post showing how (by implementing the Reactor design pattern) he created a simple web server inside a PHP application. It combines a few Symfony2 components and the React library to build a simple server in a bit more programatic way.

Normally we deploy our PHP applications in a webserver (such as apache, nginx, ). I used to have one apache webserver in my personal computer to play with my applications, but from time to now I prefer to use PHP's built-in webserver for my experiments. It's really simple. [...] With PHP we cannot do it. Sure? That assertion isn't really true. We can do it. I've just create one small library to do it in two different ways. First running the built-in web server and also running one React web server.

The idea is that all that would be needed is a stand-alone PHP script that could be run anywhere and start up its own web server, no other software required. He includes a simplified version of the example, showing how to make servers with both React and PHP's own server. He also includes an example of a basic Silex application that uses it as well as some benchmarks (with Apache ab) for each of the implementations and their request/response times on average for simple and Silex requests.

0 comments voice your opinion now!
builtin webserver server example react silex

Link: http://gonzalo123.com/2013/11/11/how-to-run-a-web-server-from-a-php-application/

VG Tech:
Using PHP's Built-in Web Server in Behat Tests
August 19, 2013 @ 10:13:16

On the VG Tech blog there's a recent post showing you how you can use the built-in PHP web server to help with running your Behat (a behavior-driven development tool) tests.

Behat is a tool for running acceptance tests for your application. If your application is a web application you will need a web server to execute your tests. [...] Some weeks back I wrote a post showing you how to use PHP's built in web server in PHPUnit. This post will show you how to do the same for Behat when running your acceptance tests.

His example (here on github) shows you how to set up Behat via Composer, run it and start in on your first test. In the test's "setUp" method, it calls out to the command line and starts up the built-in web server if it's not already running. It also checks to see if it can connect to the server to make sure it's accessible. Then, in the "tearDown" method, there's a call to kill off the PHP process based on the PID stored on startup.

0 comments voice your opinion now!
builtin webserver bdd tests behat setup teardown

Link: http://tech.vg.no/2013/08/16/using-phps-built-in-web-server-in-behat-tests

VG Tech:
Using PHP's Built-in Web Server in Your Test Suites
July 22, 2013 @ 10:47:33

PHP introduced a handy built-in web server that makes it much simpler to test applications quickly and locally than having to have a full Apache+PHP install sitting on you machine. In this new post to the VG Tech blog, they take it one step further. They suggest that you can use it for testing too.

As of PHP-5.4.0 the CLI SAPI provides a built-in web server. The web server is designed for development purposes, and serves requests sequentially. This web server can come in really handy when the need for an httpd arises during (integration) tests. In this post I'll use PHPUnit as the testing framework, and I'll show you how to start the web server during the bootstrap process, and how to shut it down when the test suite is finished.

His example shows the creation of a basic phpunit.xml configuration file, but the bootstrap is a little different than some you've seen. With the help of a few constants and a command-line call to start the web server, he gets things up and running and ready for testing. A shutdown command is also included as a registered shutdown function to clean up after the testing is done.

0 comments voice your opinion now!
webserver builtin phpunit unittest integration bootstrap tutorial

Link: http://tech.vg.no/2013/07/19/using-phps-built-in-web-server-in-your-test-suites

Chris Jones:
Using the PHP CLI Webserver to Identify and Test Memory Issues in PHP
August 15, 2012 @ 08:35:07

Chris Jones has a new post today showing how you can use PHP 5.4's built-in web server to help test for memory issues in your application (and the language).

Rasmus mentioned on IRC how he ran the [command line] tests: simply renaming the ".phpt" test files as ".php", and invoking them through the CLI webserver. The SKIPIF sections get executed, but that doesn't affect the desired outcome of testing multiple HTTP requests with different input scripts. [Here] are some quick shell scripts I put together to automate testing the OCI8 extension with valgrind.

He uses the OCI8 extension as an example, showing how to set up these scripts to enable the execution of the tests, fire up the web server and execute Valgrind to help monitor the memory of the execution.

0 comments voice your opinion now!
builtin webserver cli test unittest phpt tutorial shell


Thomas Weinart:
Using The PHP 5.4 Webserver On Windows
July 31, 2012 @ 10:35:11

Thomas Weinert has posted a helpful hint for those developing their PHP applications in a Windows environment - how you can use the PHP 5.4 built-in webserver to test your applications.

PHP 5.4 has an built-in webserver. For local development it is not necessary to install Apache Httpd or another webserver anymore. You can just start an server from the command line. [...] To make things a little easier you can create a windows shortcut.

He shows what it looks like running in a console and steps you through the process of setting up the shortcut, giving you the flexibility to contril things like window size and buffer size.

0 comments voice your opinion now!
winodws builtin webserver shortcut commandline


PHPMaster.com:
Taking Advantage of PHP's Built-in Server
March 08, 2012 @ 08:17:45

On PHPMaster.com today there's a new tutorial for those on the bleeding edge of PHP using the latest released version (5.4) and a feature that comes with it - using the built-in webserver that comes bundled for testing purposes.

One of the cooler features of the new PHP 5.4 release is a built-in web server designed specifically for development and testing. Now you can write and test your code without having to have a full-fledged LAMP configuration - just launch a the built-in server from the command line, test your code, and then shut it down when you're finished. [...] In this article I'll explain some basic uses of the new built-in server and show you how to build a portable personal development server useful for quickly testing your applications

He starts with a look at how to start up the web server (a simple command line switch and host/port definition) and the resulting default phpinfo page it displays. Other options include the ability to specify a document root for your server and create a sort of "front controller" for it to route requests. They show how to create a simple application based on this that can dynamically load in the index file, a router and pass the request off to the correct file. Their example includes some "niceties" too like logging, "hosts allowed" and checks for requesting directories.

You can find their full code for this example over on github.

0 comments voice your opinion now!
builtin server recent router feature test custom tutorial


Lorna Mitchell's Blog:
PHP 5.4 Built In Webserver
January 30, 2012 @ 11:35:09

Lorna Mitchell has posted a quick tutorial about a feature of the upcoming PHP 5.4 release, the built-in web server, and some tips on doing things like routing requests and changing the hostname.

One of the big features arriving with PHP 5.4 is the addition of a built-in basic webserver for use in development environments. Quite a few of the other scripting languages have something like this so I'm very pleased to see it in PHP. Using a server like this makes it easy to quickly try out some scripts without needing to configure apache or really do anything much! I had to look up a few things to get started, so I thought I'd write them down for posterity.

She includes instructions on how to get the server up and running from the command line, updating the location of the document root with a command line option and using a simple "routing.php" script to act as a front controller. Changing the hostname is as simple as changing "localhost" to something else when starting the server.

0 comments voice your opinion now!
webserver builtin configure tutorial server


DZone.com:
PHP 5.4 Will Have a Built-in Web Server
October 24, 2011 @ 09:24:01

As is mentioned in this new post to DZone.com, one of the features of the upcoming PHP 5.4 release, including things like traits and array dereferencing support, will also have an interesting new feature - a built-in simple web server.

Yet another new feature to look forward to in PHP 5.4.0 - the CLI SAPI will now provide a built-in web server which is geared toward developmental purposes. It shouldn't be used in production right now.

The PHP manual has been updated with the latest on this upcoming feature:

URI requests are served from the current working directory where PHP was started, unless the -t option is used to specify an explicit document root. [...] If a PHP file is given on the command line when the web server is started it is treated as a "router" script for the web server. The script is run at the start of each HTTP request. If this script returns FALSE, then the requested resource is returned as-is. Otherwise the script's output is returned to the browser.

The PHP 5.4.x series is still in beta as of the time of this post - you can download the beta1 on the downloads section of the PHP site (or the Windows binaries).

0 comments voice your opinion now!
webserver builtin server beta1 download


PHPClasses.org:
Lately in PHP Podcast Episode 10 - the Built-in Web Server, PHP 5.3.6 & PHP.js
March 30, 2011 @ 08:20:02

PHPClasses.org have posted their latest episode of the "Lately in PHP" podcast today, a discussion between Manuel Lemos and Ernani Joppert about the built-in web server that's planned for inclusion in future releases of the PHP language.

PHP is going to come with a built-in Web server, so you will no longer need Apache or any other Web server software to run PHP applications. This is the main topic discussed by Manuel Lemos and Ernani Joppert in the episode 10 of the Lately in PHP podcast.

They also talk about some security fixes and the PHP.js project. As usual, you can listen to this latest episode either through the in-page player, by downloading the mp3 or by subscribing to their feed.

0 comments voice your opinion now!
latelyinphp podcast webserver builtin phpjs



Community Events





Don't see your event here?
Let us know!


interview community framework application project configure podcast list wordpress threedevsandamaybe series language api code developer release bugfix introduction laravel library

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework