How neoPhp Server works
With version 19.4.5 and above, VisualNEO Web includes neoPhp Server as a tool.
What’s neoPhp Server?
neoPhp Server is a visual tool to integrate PHP built-in web server with VisualNEO Web.
A web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Web pages to users, in response to their requests. With neoPhp Server we can launch a local web server to access our web apps through http protocol and execute server side PHP 7 scripts.
It will allow you to use neoPhp plugin and avoid most cross site scripting errors you may get while working with local files.
How to use it?
Once you have saved your app into a location in your hard disk, launch neoPhp Server through the main menu: Tools -> NeoPhp Server.
It will start with a basic predefined configuration. The app html publishing folder (the one where the html app is compiled) will be presented as the root folder, that means the folder to be served through http by default.
Before pressing the Start button be sure to compile your app (Project -> Compile/publish) using Web Application as target platform while “Empty build folder before compile” option is unchecked. This will generate the root folder and the app files to be served to your Web Browser.
Now everything is ready to start the server: press the Start button. After a few seconds the server will be up and running and ready to serve your app. Just open your favourite Web Browser (FireFox, Chrome, Opera…) and navigate to “localhost“. Your app will be loaded and executed through http protocol as if it were actually installed in a hosting service.
How to configure it?
If you use localhost as the Binding Address, as it is by default, only a Web Browser installed in the same computer (localhost) will be able to load and execute your compiled app.
Use the IP value 0.0.0.0 instead of localhost, before starting the server, to serve the content to any local area network device. This way you can execute the app in your mobile devices just by navigating to your computer local IP address wich value is offered by neoPhp Server.
Change the default port if you have conflicts with another web server in your computer. If you change its value, be sure to add it at the end of the app URL prefixed with a colon symbol. For example: localhost:8888 for port 8888.
What is config.php template?
config.php file is a configuration file for neoPhp plugin and it’s only necessary if you are going to use that plugin.
It sets some important information that should be unique for each app as:
- Admin user and password.
- File names and file aliases allowed to be edited through neoPhp plugin.
- Databases names and aliases.
- Template SQL queries and their aliases.
We will see how to use neoPHP plugin in another post.
Do you have any doubt or thought to share?. Then please add a comment below.