The community is working on translating this tutorial into Sinhala, but it seems that no one has started the translation process for this article yet. If you can help us, then please click "More info".
If you are fluent in Sinhala, then please help us - just point to any untranslated element (highlighted with a yellow left border - remember that images should have their titles translated as well!) inside the article and click the translation button to get started. Or have a look at the current translation status for the Sinhala language.
If you see a translation that you think looks wrong, then please consult the original article to make sure and then use the vote button to let us know about it.
Please help us by translating the following metadata for the article/chapter, if they are not already translated.
If you are not satisfied with the translation of a specific metadata item, you may vote it down - when it reaches a certain negative threshold, it will be removed. Please only submit an altered translation of a metadata item if you have good reasons to do so!
PHP is a serverside language, which means that your code has to pass through the PHP interpreter, which returns the output to the users browser. That's why you need a webserver installed locally to test your code. By default, when you select preview, WebCoder will show your file by opening the local file in the preview browser, but that won't work for a PHP file, since it has to go through the server. You will need to tell WebCoder how a file path maps to the local webserver. The servermapping feature helps us do just that.
In a previous chapter, we configured the Apache webserver to work on your computer. Now you will need your localhost address, as setup earlier. Usually, it's http://localhost/ or http://localhost:8080/. In WebCoder, go to Functions and select Settings. Now, select the Preview tab and then the Servermappings tab. Make sure that the "Enable servermappings" checkbox is checked. In the "Edit servermapping" part of the dialog, enter your local document root in the first field, and your localhost address in the second field. In case you used the default values while installing Apache, the values should look something like this:
Path: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ URL: http://localhost:8080/
Check that these values work on your machine and then click the Add button. Now, click Ok in the dialog and you're good to go. If you wish to test your new setup, enter some PHP code in a document (try the Hello world chapter in this tutorial, for instance), save it in your document root (C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\) and then press F12 in WebCoder to preview it.