Let's get started with Phalcon webtools

table of contents
- 1 Create a project that can use phalcon webtools
- 2 Installing phalcon webtools into an existing project
- 3 Uninstall phalcon webtools
- 4 Try displaying the top page
- 5 If you can't access
- 6 If the link is somehow wrong
- 7 When creating a controller or model, I get the error "An unexpected error has occurred."
Hello,
I'm Mandai, the Wild Team member of the development team.
I previously wrote a blog post about the phalcon command, but unfortunately it has so many options that it seems like it would take some time to master it
In such cases, it might be a good idea to learn phalcon commands little by little later and try using the quick and easy phalcon webtools
Create a project that can use phalcon webtools
If you want to enable webtools from scratch in a new project that has not yet been created, the command is as follows:
phalcon project --name [project-name] --enable-webtools
Installing phalcon webtools into an existing project
You can also add webtools to an already created phalcon project
phalcon webtools --enable
Uninstall phalcon webtools
There will come a time when you no longer need webtools, such as when you have completed configuration or development.
In that case, you can easily uninstall it using the phalcon command.
phalcon webtools --disable
Try displaying the top page
Once you have enabled webtools, try viewing it in your browser.
If you have set the document root of your web server to public, you can access it at http://localhost/webtools.php
If something is displayed but the stylesheet is not working properly, add write permissions to public/css and public/js and access webtools.php again
cd /path/to/project_root/public/ chmod a+w css js
The actual CSS and JS files are stored in the resources directory in phalcon-devtools, and are copied to the development environment the first time a request is made.
If you do not have write permission to the directory, the files cannot be copied.
Here is the homepage with all the necessary elements included
This was created with Phalcon dev-tools 3.0.4, and the layout has changed significantly from previous versions
There have also been some changes to the functionality, and config settings can no longer be made from webtools.
Therefore, database settings and other settings must be configured outside of webtools in advance.
If you can't access
There are probably several patterns, but I'll list the ones I've encountered
Access from IP addresses other than those set in webtools.config.php
In this case, you will encounter a screen like this:
The file webtools.config.php generated under public contains the IP addresses that can be accessed
By default, the range is set to 192.168.0.0/16.
I happened to want to take a screenshot and wanted to access it from outside VirtualBox, but this setting caused me to get stuck.
If the link is somehow wrong
There are several links on the top page, but if they are in the format of "/webtools.php/webtools.php?_url=/info", check the baseUri setting.
If the document root is set to "project root + public", there is no need to set baseUri in config/config.php, so just set it to "/".
invo which is also introduced in the official documentation , /invo/ is set.
When creating a controller or model, I get the error "An unexpected error has occurred."
This is the same reason why CSS and JS cannot be loaded: you do not have write permissions to the controller or model directories
I often have trouble with the lack of write permissions in the local environment, but after tweaking directory permissions during development, it's a hassle to go back and reset them when moving to the production environment, so changing the execution user on the web server side might be one solution.
Also, if you grep /var/log/messages with "SELinux" and find it, it means that SELinux is interfering with something.
sudo setenforce 0
There are also some taboo moves that involve:
That's all
0
