Hi guys, those who have not gone through my last posts, where I have explained step by step how to set up the CakePHP development environment, may check this link Home.
In this post we will proceed further to verify what we have done earlier. You can proceed step by step and confirm that everything is working fine.
Check Our Web Server Apache is working fine?
Open your XAMPP control panel form start menu, once it is started click on the start button opposite to service labelled “Apache”. It will take few seconds to start, once it is Green it means it is running in the background. In case you see the below message in the message window. Follow my post How to install and configure CakePHP 4.0?
Problem detected!
Port 443 in use by ""C:\Program Files (x86)\VMware\VMware
Workstation\vmware-hostd.exe" -u
"C:\ProgramData\VMware\hostd\config.xml"" with PID 11356!
Apache WILL NOT start without the configured ports free!
You need to uninstall/disable/reconfigure the blocking application
or reconfigure Apache and the Control Panel to listen on a different port
Once you are good to go, open your web browser and type “localhost”
in the address bar. It will open the welcome screen of XAMPP dashboard.

You can check the information about installed PHP version by
clicking the PHPInfo link on the welcome screen.
Further you can verify your PHP version by typing “PHP -v”
on command prompt.

Write your First Hello World script
Guys, if you check the PHPInfo page on XAMPP dashboard,
under the Apache Environment section, you will notice that there is one environment
variable defined “DOCUMENT_ROOT” its value is “C:/xampp/htdocs” in my case,
this is the root folder. All the PHP applications are stored under this root
folder. If you want to change this location you can change it in the “httpd.conf”
file.
Let’s create a folder under this root, name it “HelloWorld”,
create a text file, with the help of any text editor and name it “index.php”. Don’t
forget its extension. Copy the below code in the file and save it.
<?php
echo "Hello World! </br>";
echo "My First PHP script";
Now move to web browser and type in the address bar “localhost/helloworld”
you will see the below result.

So you have successfully executed the your first PHP script.
In the next post we will discover it in more detail, stay with us and subscribe the blog.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.