- PHP is an amazing and popular language!
- PHP is an acronym for “PHP: Hypertext Preprocessor”
- PHP is a widely-used, open source scripting language
- PHP scripts are executed on the server
- PHP is free to download and use
It is powerful enough to be at the core of the biggest blogging system on the web (WordPress)!
It is deep enough to run the largest social network (Facebook)!
It is also easy enough to be a beginner’s first server side language!
Use of PHP
- PHP can generate dynamic page content
- PHP can create, open, read, write, delete, and close files on the server
- PHP can collect form data
- PHP can send and receive cookies
- PHP can add, delete, modify data in your database
- PHP can be used to control user-access
- PHP can encrypt data
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft’s ASP.PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft’s ASP. PHP 7 is the latest stable release.
What’s new in PHP 7
- PHP 7 is much faster than the previous popular stable release (PHP 5.6)
- PHP 7 has improved Error Handling
- PHP 7 supports stricter Type Declarations for function arguments
- PHP 7 supports new operators (like the spaceship operator:
Before you continue you should have a basic understanding of the following:
1) PHP requires the Visual C runtime(CRT). Many applications require that so it may already be installed
PHP 5.5 and 5.6 require VC CRT 11 (Visual Studio 2012). See: https://www.microsoft.com/en-us/download/details.aspx?id=30679
You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. If CRT is already installed, the installer will tell you that and not change anything.
2) https://windows.php.net/download/ prefer to use 7.4, so I downloaded the latest Non-thread-safe 64-bit version of 7.4 downloaded the .zip file version of the
VC14 x64 Non Thread Safe edition, under the PHP 7.1 heading.
3) Expand the zip file into the path
4)Configure PHP to run correctly on your system:
- In the
C:\PHP7folder, rename the file
- Edit the
php.inifile in a text editor visualstudio code – https://code.visualstudio.com/?wt.mc_id=DX_841432 .
- Change the following settings in the file and save the file:
1G(because Composer can use lots of memory!)
- Uncomment the line that reads
; extension_dir = "ext"(remove the
;so the line is just
extension_dir = "ext")
- In the section where there are a bunch of
extension=lines, uncomment the following line
C:\PHP7 to your Windows system path:
- Open the System Control Panel.
- Click ‘Advanced System Settings’.
- Click the ‘Environment Variables…’ button.
- Click on the
Pathrow under ‘System variables’, and click ‘Edit…’
- Click ‘New’ and add the row
- Click OK, then OK, then OK, and close out of the System Control Panel.
6) Open PowerShell or another terminal emulator (I generally prefer CMD ), and type in
php -v to verify PHP is working.
At this point, you should see output like:
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\BLUE202> php -v
PHP 7.0.29 (cli) (built: Mar 27 2018 15:23:04) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
This means PHP is working.
Download and Install PHP in Windows is done now you can use example code like this and you can also google for codes.
<!DOCTYPE html> <html> <body> <?php echo "My first PHP script!"; ?> </body> </html>
Comment below if you get any problem i will try to solving it.