Phalcon entry guide
- Preface
- 1. Installation
- 2. Phalcon development tool installation
- 3. Environment variable configuration
- 4. Use of Phalcon development tools
- Generate project framework
- Generate controller/model
- Praise phalcon
- 5. Summary
I remember where I saw this framework before However, companies that I have recently joined are using this framework, so let’s take a look at Kaka’s entry guide!
First of all, no matter how efficient the framework is, the installation process is really a pitfall at every step!
Officially, it is the fastest among the PHP frameworks, 15 times faster than ThinkPHP, which is pretty good!
But I still want to complain about this framework. When installing the toolkit, I installed phalcon3.4.3 for the first time, and then it was prompted that it needed to be upgraded to version 4.0.0.
This is nothing, then upgrade! After downloading 4.0.0, it said that it needs to be upgraded to 4.0.3.
If that’s okay, continue downloading. This time I downloaded 4.0.6 directly. Listening to the official version, I guess the installation will not be successful overnight.
Installation environment:
- PHP7.2
- phalcon_x64_vc15_php7.2_4.0.6 5190_nts.zip
- phpstudy
Download address: https://github.com /phalcon/cphalcon/releases/tag/v4.0.6
Put the downloaded dll file into the PHP extension directory
Then add the corresponding dll information in the php.ini file.
Restart the server and output the version information in the PHP file
##
psr download address: https://pecl.php.net/package/psr/0.7.0/windows
If you find that the installation fails, Thinking about installing it! I was so manipulated by this framework that I lost my temper. Mine is that the ddl file cannot be found.
If you also downloaded it, you also need to put the extension file in the directory corresponding to the PHP version.
2. Phalcon development tool installation
Use git to clone, the address is
git clone https://github.com/phalcon/phalcon-devtools.git
Copy after login
Then put the file on the desktop, open the directory and find the location shown below
Right-click the mouse to modify the path address
Then execute phalcon in the command line and you will see the information in the picture below. You need to pay attention here. The corresponding information will be prompted. Just follow the operation.
The final result is like this. To be honest, setting up this environment is a waste of effort. No wonder few people in China use it.
3. Environment variable configuration
This section should not appear here, but I still write it for the novices. I hope it will be This article can directly solve all your installation problems.
Configuring environment variables is an operation that some people have not configured before, because most of them use PhpStudy locally as the development environment.
##Click Advanced System Configuration
Click on environment variables
Then click OK one by one in the order in which they are opened.
4. Use of Phalcon development tools
It should be noted here that phalcon-devtools needs to be configured in the path installation directory.
If you can’t remember the command, you can directly execute `phalcon commands
Generate project framework
Here Kaka uses the Phpstudy integrated environment and executes the create project framework command directly in the www directory.
Execute commandphalcon create-project phalcon
## Return to the www directory to see the generated project.
Then configure a virtual domain name in Phpstudy and configure it under public.
Let’s look at the configuration of the database information first!
Generate controller/model
phalcon create-controller --name User
The corresponding file will be generated.
In the installation At that time, I said ten thousand words of "I love you" to phalcon in my heart (Cao Ni Ma). But while here, I still give a thumbs up for the functions not covered by the phalcon command.
The picture above shows that after modification, the model file still exists after execution. This is more thoughtful than fastadmin.
It’s not easy to get here first in this issue! The frameworks are all the same, so don’t put too much energy into it, just have a general understanding.
The implementation principles are the same.
This article needs to pay attention to the following points
- Pay attention to your own PHP environment
- Pay attention to the version of phalcon downloaded Is it compatible with your own PHP environment?
- Pay attention to the configuration of environment variables
The next issue will write about the practical application of phalcon
Persistence in learning, persistence in writing, and persistence in sharing are the beliefs that Kaka has always adhered to since its beginning. I hope that Kaka’s articles on the huge Internet can bring you a little bit of help. I’m Kaka, see you next time.
The above is the detailed content of Phalcon installation on Windows 'Phalcon pit guide series 1'. For more information, please follow other related articles on the PHP Chinese website!