# Unable to access practice settings

**URL:** <https://community.open-emr.org/t/unable-to-access-practice-settings/15947>\
**Category:** Support\
**Created:** [January 31, 2021, 2:29am UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947 "2021-01-31T02:29:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralf\_Lukner](https://community.open-emr.org/user_avatar/community.open-emr.org/ralf_lukner/32/11962_2.png) [@Ralf\_Lukner](https://community.open-emr.org/u/Ralf_Lukner)\
**Post date:** [January 31, 2021, 2:29am UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/1 "2021-01-31T02:29:58Z")

</div>

**Situation**  
I am unable to access my practice settings. When I attempt to, I get the following error:  
Unable to load controller PracticeSettings , please check the first argument supplied in the URL and try again

**OpenEMR Version**  
I’m using OpenEMR version: v5.0.2 (5).

**Browser** :  
I’m using: Google Chrome (MacOS) is up to date Version 88.0.4324.96 (Official Build) (x86\_64)

**Operating System**  
I’m using: AWS Ubuntu 16.04.7 LTS (GNU/Linux 4.15.0-1091-aws x86\_64).

**Logs**

```auto
[Sun Jan 31 02:23:43.191652 2021] [php7:warn] [pid 21815] [client xx.yy.zz.aaa:56354] PHP Warning: include_once(/var/www/localhost/htdocs/opener/controllers/C_PracticeSettings.class.php): failed to open stream: No such file or directory in /var/www/localhost/htdocs/openemr/library/classes/Controller.class.php on line 71, referer: https://xxxxxxxx.com/interface/main/tabs/main.php?token_main=cZxAZBRxMRRB3EM3u8ySOAGG2ZbQPMybn7G43kjA
[Sun Jan 31 02:23:43.191717 2021] [php7:warn] [pid 21815] [client xx.yy.zz.aaa:56354] PHP Warning: include_once(): Failed opening ‘/var/www/localhost/htdocs/openemr/controllers/C_PracticeSettings.class.php’ for inclusion (include_path=‘/var/www/localhost/htdocs/openemr/vendor/pear/archive_tar:/var/www/localhost/htdocs/openemr/vendor/pear/console_getopt:/var/www/localhost/htdocs/openemr/vendor/pear/pear-core-minimal/src:/var/www/localhost/htdocs/openemr/vendor/pear/pear_exception:.:/usr/share/php7’) in /var/www/localhost/htdocs/openemr/library/classes/Controller.class.php on line 71, referer: https://xxxxxxxxx.com/interface/main/tabs/main.php?token_main=cZxAZBRxMRRB3EM3u8ySOAGG2ZbQPMybn7G43kjA

```

---

<div class="post-metadata">

**Author:** ![Ralf\_Lukner](https://community.open-emr.org/user_avatar/community.open-emr.org/ralf_lukner/32/11962_2.png) [@Ralf\_Lukner](https://community.open-emr.org/u/Ralf_Lukner)\
**Post date:** [February 7, 2021, 6:13pm UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/2 "2021-02-07T18:13:20Z")

</div>

This is a bump to bump this thread. I’m still hoping to get some help with identifying the issue and correcting it. Any ideas?

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [February 7, 2021, 6:37pm UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/3 "2021-02-07T18:37:54Z")

</div>

looks like there’s a typo in the script that tried to include

```auto
[Sun Jan 31 02:23:43.191652 2021] [php7:warn] [pid 21815] [client xx.yy.zz.aaa:56354] PHP Warning: include_once(/var/www/localhost/htdocs/opener/controllers/C_PracticeSettings.class.php)

```

see how openemr is spelled opener?

it’s prob in

```auto
interface/main/tabs/menu/menus/standard.json
```

---

<div class="post-metadata">

**Author:** ![Ralf\_Lukner](https://community.open-emr.org/user_avatar/community.open-emr.org/ralf_lukner/32/11962_2.png) [@Ralf\_Lukner](https://community.open-emr.org/u/Ralf_Lukner)\
**Post date:** [February 7, 2021, 7:11pm UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/4 "2021-02-07T19:11:59Z")

</div>

I think this is at least one of the relevant sections of

```auto
interface/main/tabs/menu/menus/standard.json

```

and it looks benign:

```auto
      {                                                                         
        "label": "Practice",                                                    
        "menu_id": "adm0",                                                      
        "target": "adm",                                                        
        "url": "/controller.php?practice_settings&pharmacy&action=list",        
        "children": [],                                                         
        "requirement": 0,                                                       
        "acl_req": [                                                            
          "admin",                                                              
          "practice"                                                            
        ]                                                                       
      },                                                                        

```

But somehow the path is not being assembled correctly for some reason. I wonder why.

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [February 7, 2021, 7:19pm UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/5 "2021-02-07T19:19:46Z")

</div>

this seems vaguely familiar, did you have a similar issue a year or two ago?

---

<div class="post-metadata">

**Author:** ![Ralf\_Lukner](https://community.open-emr.org/user_avatar/community.open-emr.org/ralf_lukner/32/11962_2.png) [@Ralf\_Lukner](https://community.open-emr.org/u/Ralf_Lukner)\
**Post date:** [February 7, 2021, 7:26pm UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/6 "2021-02-07T19:26:09Z")

</div>

There was a somewhat similar issue that involved reports [Unable to run reports: Not Found: The requested URL /report/patient\_report.php was not found on this server](https://community.open-emr.org/t/unable-to-run-reports-not-found-the-requested-url-report-patient-report-php-was-not-found-on-this-server/13815/11) … I will take a look at the user settings (patient menu role, etc.) and see if this where the problem is.

---

<div class="post-metadata">

**Author:** ![Ralf\_Lukner](https://community.open-emr.org/user_avatar/community.open-emr.org/ralf_lukner/32/11962_2.png) [@Ralf\_Lukner](https://community.open-emr.org/u/Ralf_Lukner)\
**Post date:** [February 7, 2021, 7:36pm UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/7 "2021-02-07T19:36:11Z")

</div>

It doesn’t look like there is anything non-standard in my menu settings under my user.  
(See image)

 ![IMG_2673](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/3/32f95114c485bbce765f356120d7b7d78b1fe8e4.jpeg)

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [February 7, 2021, 7:45pm UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/8 "2021-02-07T19:45:11Z")

</div>

checkout that custom.json script as before

---

<div class="post-metadata">

**Author:** ![Ralf\_Lukner](https://community.open-emr.org/user_avatar/community.open-emr.org/ralf_lukner/32/11962_2.png) [@Ralf\_Lukner](https://community.open-emr.org/u/Ralf_Lukner)\
**Post date:** [February 8, 2021, 3:35am UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/9 "2021-02-08T03:35:09Z")

</div>

```auto
/var/www/localhost/htdocs/openemr # find ./ -name custom.json
/var/www/localhost/htdocs/openemr # 

```

I’m unable to find a custom.json file.  
–RBL

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [February 8, 2021, 1:07pm UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/10 "2021-02-08T13:07:47Z")

</div>

> [@Ralf\_Lukner](#):
>
> find ./ -name custom.json

`find . -name Custom.json`

---

<div class="post-metadata">

**Author:** ![Ralf\_Lukner](https://community.open-emr.org/user_avatar/community.open-emr.org/ralf_lukner/32/11962_2.png) [@Ralf\_Lukner](https://community.open-emr.org/u/Ralf_Lukner)\
**Post date:** [February 9, 2021, 3:32am UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/11 "2021-02-09T03:32:13Z")

</div>

> [@stephenwaite](#):
>
> find . -name Custom.json

Perfect. Found two files:

```auto
./sites/default/documents/custom_menus/Custom.json
./sites/default/documents/custom_menus/patient_menus/Custom.json

```

The first file has the usual benign appearing JSON elements (without the initial part of the path):

```auto
      {                  
        "label": "Practice",
        "menu_id": "adm0",  
        "target": "adm",    
        "url": "/controller.php?practice_settings&pharmacy&action=list",
        "children": [],                                                 
        "requirement": 0,                                               
        "acl_req": [                                                    
          "admin",                                                      
          "practice"                                                    
        ]                                                               
      },                                                                

```

The second file does not contain “Practice”. I wish I knew how the complete path was assembled so that I could understand why the overall path is not correct.

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [February 9, 2021, 4:11am UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/12 "2021-02-09T04:11:01Z")

</div>

Hi Ralf,  
I’ll take a quick look to at least see where the url gets mangled. The smarty controller errors can be a little difficult to track.

> [@Ralf\_Lukner](#):
>
> I wish I knew how the complete path was assembled so that I could understand why the overall path is not correct.

Come from web\_root which is your root openemr directory however, it appears you have a path set somewhere that is including the the root directory ie `opener/controller.php?practice_settings&.....`

The first error causes the second so ignore second.

If you have ability to search soure code with your IDE then do a code search for say, ‘opener/’ or similar…

---

<div class="post-metadata">

**Author:** ![Ralf\_Lukner](https://community.open-emr.org/user_avatar/community.open-emr.org/ralf_lukner/32/11962_2.png) [@Ralf\_Lukner](https://community.open-emr.org/u/Ralf_Lukner)\
**Post date:** [February 11, 2021, 12:30pm UTC](https://community.open-emr.org/t/unable-to-access-practice-settings/15947/13 "2021-02-11T12:30:32Z")

</div>

Here is the code that generates the error message.

```auto
    function act($qarray)                                                                                                                                                      
    {                                                                                                                                                                          
                                                                                                                                                                               
        if (isset($_GET['process'])) {                                                                                                                                         
            unset($_GET['process']);                                                                                                                                           
            unset($qarray['process']);                                                                                                                                         
            $_POST['process'] = "true";                                                                                                                                        
        }                                                                                                                                                                      
                                                                                                                                                                               
            $args = array_reverse(array_keys($qarray));                                                                                                                        
            $c_name = preg_replace("/[^A-Za-z0-9_]/", "", array_pop($args));                                                                                                   
            $parts = explode("_", $c_name);                                                                                                                                    
            $name = "";                                                                                                                                                        
                                                                                                                                                                               
        foreach ($parts as $p) {                                                                                                                                               
            $name .= ucfirst($p);                                                                                                                                              
        }                                                                                                                                                                      
                                                                                                                                                                               
            $c_name = $name;                                                                                                                                                   
            $c_action = preg_replace("/[^A-Za-z0-9_]/", "", array_pop($args));                                                                                                 
            $args = array_reverse($args);                                                                                                                                      
                                                                                                                                                                               
        if (!call_user_func(array("Controller","i_once"), $GLOBALS['fileroot'] ."/controllers/C_" . $c_name . ".class.php")) {                                                 
            echo "Unable to load controller $name\n, please check the first argument supplied in the URL and try again";                                                       
            exit;                                                                                                                                                              
        }                                                                                                                                                                      
                                                                                                                                                                               
            $obj_name = "C_" . $c_name;                                                                                                                                        
            $c_obj = new $obj_name();                                                                                                                                          
                                                                                                                                                                               
        if (empty($c_action)) {                                                                                                                                                
            $c_action = "default";                                                                                                                                             
        }                                                                                                                                                                      
                                                                                                                                                                               
            $c_obj->_current_action = $c_action;                                                                                                                               
            $args_array = array();                                                                                                                                             
                                                                                                                                                                               
- Controller.class.php [Readonly] 96/176 54%

```
