We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Webtools incorrect baseUri

Hi guys, I'm not sure if I missed some command line option or not, in any case here is the problem:

If you create a virtual host and configure it to be accessed by https://myproject/ instead of https://localhost/myproject, and then if you create a phalcon project with webtools:

$ phalcon create-project myproject --enable-webtools

The resulting baseUri is wrong. It will be '/myproject' but it needs to be simply '/'. It's easy to fix it in the config.php, but I'm just alerting you that it may happen. If I didn't miss any option maybe it should be an option or at least it should be stated somewhere!

Cheers!



98.9k

Check the URL service registration:

$di->set('url', function() {
    $url = new \Phalcon\Mvc\Url();
    $url->setBaseUrl('/');
    return $url;
}, true);


32.2k
Accepted
answer

I already fixed it, like I said. I just wanted to point to the fact that if you use phalcon dev tools to create a project it will not always work right away ;) Thanks for the feedback.