CodeIgniter Forums
problem with PHP_SELF - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: problem with PHP_SELF (/showthread.php?tid=74792)



problem with PHP_SELF - richb201 - 11-06-2019

I think I found the problem.

I see this variable being set:
PHP_SELF=/opt/project/app/index.php
                               ^
But this is not where my index.php is. It is in /opt/docker-substantiator/app/index.php. It seems that all the paths to my config files has that extra /project in them. 

Where is that path with the term "project" coming from?


RE: problem with PHP_SELF - John_Betong - 11-06-2019

(11-06-2019, 07:39 PM)richb201 Wrote: I think I found the problem.

I see this variable being set:
PHP_SELF=/opt/project/app/index.php
                               ^
But this is not where my index.php is. It is in /opt/app/index.php. It seems that all the paths to my config files has that extra /project in them. 

Where is that path with the term "project" coming from?


CodeIgniter-3.1.11/system/core/Input.php:
  651: // Sanitize PHP_SELF
  652: $_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);


Edit:
Have you hard-coded the following variables?

CodeIgniter-3.1.11/application/config/config.php -> $config['base_url'] = '';
CodeIgniter-3.1.11/application/config/config.php -> $config['index_page'] = 'index.php';


RE: problem with PHP_SELF - richb201 - 11-07-2019

(11-06-2019, 09:31 PM)John_Betong Wrote:
(11-06-2019, 07:39 PM)richb201 Wrote: I think I found the problem.

I see this variable being set:
PHP_SELF=/opt/project/app/index.php
                               ^
But this is not where my index.php is. It is in /opt/app/index.php. It seems that all the paths to my config files has that extra /project in them. 

Where is that path with the term "project" coming from?


CodeIgniter-3.1.11/system/core/Input.php:
  651: // Sanitize PHP_SELF
  652: $_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);


Edit:
Have you hard-coded the following variables?

CodeIgniter-3.1.11/application/config/config.php -> $config['base_url'] = '';
CodeIgniter-3.1.11/application/config/config.php -> $config['index_page'] = 'index.php';

I have this:

$config['base_url'] = 'http://localhost';
$config['index_page'] = 'index.php';    

The structure is /opt/docker-substantiator/application/config/


In my index.php I have

$application_folder = 'application';

and index.php is located at /opt/docker-substantiator/app/index.php

I did find a file called php-docker-settings.xml that contains this reference to project and changed it to docker-substantiator and now it seems to run again so that change appears to have fixed it. 

?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="PhpDockerContainerSettings">
    <list>
      <map>
        <entry key="87356c7c-8e09-4546-b198-eef6bb5f1xxx">
          <value>
            <DockerContainerSettings>
              <option name="version" value="1" />
              <option name="volumeBindings">
                <list>
                  <DockerVolumeBindingImpl>
                    <option name="containerPath" value="$PROJECT_DIR$/../project" />    <<<<< I changed this /project to /docker-substantiator
                    <option name="hostPath" value="$PROJECT_DIR$" />
                  </DockerVolumeBindingImpl>
                </list>
              </option>
            </DockerContainerSettings>
          </value>
        </entry>
      </map>
    </list>
  </component>
</project>


RE: problem with PHP_SELF - siddhsoftware - 11-08-2019

Thank you for the detailed Information. I was facing the same issue and than i tried according to this. First few times it was showing me the same error but finally it went well. Thank you once again.