Skip to content

baseUri is not being used when resolving the url #1418

Closed
@DeaDSouL

Description

@DeaDSouL

baseUri is not being used when resolving the url. Also, the setting in app\config.php is not right (the default value is / ).

Expected and Actual Behavior

baseUri should be treated as directory/ies not as controllers .

Describe what you are trying to achieve and what goes wrong.
I'm trying to host my phalcon-project inside a folder called phalcons/ . but the thing is that when I try to do that, phalcon fails to recognize 'phalcons/' as directory instead of controller. and it throws this error

PhalconsController handler class cannot be loaded
#0 [internal function]: Phalcon\Mvc\Dispatcher->throwDispatchException('PhalconsControl...', 2)
#1 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->dispatch()
#2 /var/www/html/phalcons/proj1/public/index.php(44): Phalcon\Mvc\Application->handle('/phalcons/proj1...')
#3 {main}

so, phalcon thinks that 'phalcons/' is a controller, while it is a directory .

Provide minimal script to reproduce the issue

mkdir /var/www/html/phalcons
cd /var/www/html/phalcons
phalcon project proj1 simple --enable-webtoos
curl http://localhost/phalcons/proj1

Details

  • System info and versions (if possible): (phalcon info)
Environment:
  OS: Linux 5901e005343d 3.10.0-1062.9.1.el7.x86_64 #1 SMP Fri Dec 6 15:49:49 UTC 2019 x86_64
  PHP Version: 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da
  PHP SAPI: cli
  PHP Bin: /usr/bin/php7.3
  PHP Extension Dir: /usr/lib/php/20180731
  PHP Bin Dir: /usr/bin
  Loaded PHP config: /etc/php/7.3/cli/php.ini
Versions:
  Phalcon DevTools Version: 4.0.1
  Phalcon Version: 4.0.2
  AdminLTE Version: 2.3.6
  • Phalcon Framework version: (php --ri phalcon)
Phalcon is a full stack PHP framework, delivered as a PHP extension, offering lower resource consumption and high performance.
phalcon => enabled
Author => Phalcon Team and contributors
Version => 4.0.2
Build Date => Jan 12 2020 01:52:52
Powered by Zephir => Version 0.12.15-814db50

Directive => Local Value => Master Value
phalcon.db.escape_identifiers => On => On
phalcon.db.force_casting => Off => Off
phalcon.orm.case_insensitive_column_map => Off => Off
phalcon.orm.cast_last_insert_id_to_int => Off => Off
phalcon.orm.cast_on_hydrate => Off => Off
phalcon.orm.column_renaming => On => On
phalcon.orm.disable_assign_setters => Off => Off
phalcon.orm.enable_implicit_joins => On => On
phalcon.orm.enable_literals => On => On
phalcon.orm.events => On => On
phalcon.orm.exception_on_failed_save => Off => Off
phalcon.orm.exception_on_failed_metadata_save => On => On
phalcon.orm.ignore_unknown_columns => Off => Off
phalcon.orm.late_state_binding => Off => Off
phalcon.orm.not_null_validations => On => On
phalcon.orm.update_snapshot_on_save => On => On
phalcon.orm.virtual_foreign_keys => On => On
phalcon.warning.enable => On => On
  • PHP Version: (php -v)
PHP 7.3.13-1+0~20191218.50+debian9~1.gbp23c2da (cli) (built: Dec 18 2019 15:03:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.13, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.13-1+0~20191218.50+debian9~1.gbp23c2da, Copyright (c) 1999-2018, by Zend Technologies
Server version: Apache/2.4.25 (Debian)
Server built:   2019-10-13T15:43:54

It happens on windows, ubuntu 18.04 and debian 9

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions