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.

Phalcon webtools 403 error (Forbidden :: Phalcon WebTools)

  1. I created a phalcon project on the server in the directory /home/admin/web/mysite.com/public_html/test

  2. Installed devtools in the directory /home/admin/phalcon-devtools

  3. I configured apache2.conf openbasedir to access /home/admin/phalcon-devtools directory.

  4. Assigned PTOOLS_IP value in webtools.config.php to "46." (My ip address subnet) .

  5. The owner of the directory and files in /home/admin/phalcon-devtools is the same as the site folder /home/admin/web/mysite.com/public_html/test (admin:admin)

I follow the link mysite.com/test/webtools.php and get an error 403:

403 Forbidden

Sorry! You are not allowed to access this page.

Apparently, this is a mistake of the Phalcon, because the error page is displayed through the Falcon template and the page title is "Forbidden :: Phalcon WebTools".

The site itself based on the Phalcon is working correctly (mysite.com/test/)

Please, help me setup the Phalcon webtools to work correctly.



30.7k
edited Mar '17

Hi,

try provide the full ip adress in public/webtools.config.php

be carefull, if you have install phalcon and phalcon-devtools on an online host and try to access to it trough your personnal computer, the ip adress you should provide is the one that was assigned to you by your internet provider and not the one you have in your local network

otherwise disable check access via IP address just remove the 'ptools_ip' key in public/webtools.php (really bad idea if you're in the case of an online server)

$bootstrap = new Bootstrap([
    'ptools_path' => PTOOLSPATH,
   // 'ptools_ip'   => PTOOLS_IP, // <---- Here
    'base_path'   => BASE_PATH,
]);
edited Mar '17

I removed ptools_ip, cleaned the cache, the situation on the page http://mysite.com/webtools.php did not change... http://i.imgur.com/zGi5JZr.png http://i.imgur.com/KWB6Glg.png http://i.imgur.com/qMSvrgx.png http://i.imgur.com/5k49ljw.png

Help!, webtools is not working((



30.7k

are you sure apache is running under the admin user (in console use: ps aucx|grep apache) ?

edited Mar '17

are you sure apache is running under the admin user (in console use: ps aucx|grep apache) ?

It is running under root:

[email protected]:~# ps aucx|grep apache

root 14111 0.0 0.5 149412 24040 ? Ss 12:29 0:00 apache2

Apache2.conf shown above is generated automatically by vestacp. I just added a directory with devtools.



30.7k

try to remove the open_basedir in your apache vhost config

from comments in my php.ini (you can -and that's what yiu're doing- override php.ini general directive in per virtualhost config file):

; open_basedir, if set, limits all file operations to the defined directory
; and below.  This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
;open_basedir =

I understand that while webtools are outside your web app directory, webtools.php could not access to /home/admin/phalcon-devtools directory.

personnaly, I've never use all your custom config in apache vhost, and I keep them as simple as they are described in the doc :

https://docs.phalconphp.com/en/latest/reference/apache.html



919
Accepted
answer
edited Mar '17

try to remove the open_basedir in your apache vhost config

from comments in my php.ini (you can -and that's what yiu're doing- override php.ini general directive in per virtualhost config file):

```

; openbasedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory ; or per-virtualhost web server configuration file. ; http://php.net/open-basedir ;openbasedir =

```

I understand that while webtools are outside your web app directory, webtools.php could not access to /home/admin/phalcon-devtools directory.

personnaly, I've never use all your custom config in apache vhost, and I keep them as simple as they are described in the doc :

https://docs.phalconphp.com/en/latest/reference/apache.html

The problem was in incorrect $SERVER['REMOTEADD'] value - apache2 rpafmodule not worked propertly and the IP was wrong. According to Phalcon devtools sources $SERVER['REMOTE_ADD'] is used to determine user IP.