Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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 http://myproject/ instead of http://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!



84.5k

Check the URL service registration:

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


20.7k
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.