Could you point what is preventing a Codeigniter app that is perfectly running localy to run in a remote server?

Eduardo Fuerte
Eduardo Fuerte used Ask the Experts™
on
Hi Experts

Could you point what is preventing a Codeigniter app that is perfectly running localy to run in a remote server?

I'm facing this amazing occurrence:
When the complete app is locally copied and pasted under remote server htdocs folder, the adjustments are done in config.php and database.php

img001
config.php
// IP Configured
$config['base_url'] = 'http://10.xxx.x.223/meetasas_system/'

Open in new window


database.php is correctly pointing DB after some changes.

When the app is called the controller auth is not found... but it exists as the picture below shows.

Is it a matter of any other configuration?

Could you point a workaround?

Thanks in advance!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Does your application use a .htaccess file - have you checked that?
Eduardo FuerteDeveloper and Analyst

Author

Commented:
Hi Julian

Really the app copyed to the server,  itself has 04   .htaccess   files, accordingly to:
img001
The 03 initials

<IfModule authz_core_module>
	Require all denied
</IfModule>
<IfModule !authz_core_module>
	Deny from all
</IfModule>

Open in new window


The last:

RewriteEngine On
RewriteRule ^(/)?$ index.php/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php/$1 [L]

php_value memory_limit 200M

Open in new window


But these doesn't prevent it to run locally and in another server I alternativally choosed (the use of the  other server workarounded the problem by now)
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
The problem is that the path to the controller is not being configured internally by the app - it thinks it is somewhere else.

This is either in the config or .htaccess that this happens.

I am confused by your original post - is the image of the working or non-working environment - assume the latter?

Is the problem that it works locally but not on the server.

If so what does the local environment (file system) look like?
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

Eduardo FuerteDeveloper and Analyst

Author

Commented:
Right, the image is from no-working environment.

The local environment was completely copyed from local to remote server - no modifications!
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
So the file system was identical - same paths?
Eduardo FuerteDeveloper and Analyst

Author

Commented:
Yes, Julian.

I compressed the complete application (rar) and  the descompressed under htdocs.

The local app runs under XAMPP and the remote directly under Apache.
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
So the only difference is that one is XAMP and the other is Apache.

Can you run this script from both locations so we can compare the output

<?php
echo "<pre>" . print_r($_SERVER, true) . "</pre>";

Open in new window

Eduardo FuerteDeveloper and Analyst

Author

Commented:
Sorry the delay.
I couldn't access this server.
Eduardo FuerteDeveloper and Analyst

Author

Commented:
Hi Julian

Here is the results of the script:
// Remote Server => Doesn't run

Array
(
    [HTTP_HOST] => localhost
    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_ACCEPT_LANGUAGE] => pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_COOKIE] => ci_session_sas=4a607ea4f9422ebc354a54d08b9ae0e6146b1ba7
    [HTTP_CONNECTION] => keep-alive
    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
    [PATH] => C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\PHP\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\TortoiseSVN\bin;
    [SystemRoot] => C:\Windows
    [COMSPEC] => C:\Windows\system32\cmd.exe
    [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    [WINDIR] => C:\Windows
    [SERVER_SIGNATURE] => 
    [SERVER_SOFTWARE] => Apache/2.2.21 (Win32) PHP/5.3.13
    [SERVER_NAME] => localhost
    [SERVER_ADDR] => 127.0.0.1
    [SERVER_PORT] => 80
    [REMOTE_ADDR] => 127.0.0.1
    [DOCUMENT_ROOT] => C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs
    [SERVER_ADMIN] => admin@motiva.matriz
    [SCRIPT_FILENAME] => C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/projeto_system/teste_servidor.php
    [REMOTE_PORT] => 55443
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => 
    [REQUEST_URI] => /projeto_system/teste_servidor.php
    [SCRIPT_NAME] => /projeto_system/teste_servidor.php
    [PHP_SELF] => /projeto_system/teste_servidor.php
    [REQUEST_TIME] => 1491828953
)

// Local => runs ok
Array
(
    [MIBDIRS] => C:/xampp/php/extras/mibs
    [MYSQL_HOME] => \xampp\mysql\bin
    [OPENSSL_CONF] => C:/xampp/apache/bin/openssl.cnf
    [PHP_PEAR_SYSCONF_DIR] => \xampp\php
    [PHPRC] => \xampp\php
    [TMP] => \xampp\tmp
    [HTTP_HOST] => localhost
    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_ACCEPT_LANGUAGE] => pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_CONNECTION] => keep-alive
    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
    [PATH] => C:\ProgramData\Oracle\Java\javapath;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\OpenVPN\bin;C:\Program Files\Git\cmd;C:\ProgramData\ComposerSetup\bin;C:\xampp\php;C:\Program Files\010 Editor;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Users\Ricardo\AppData\Roaming\Composer\vendor\bin
    [SystemRoot] => C:\WINDOWS
    [COMSPEC] => C:\WINDOWS\system32\cmd.exe
    [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    [WINDIR] => C:\WINDOWS
    [SERVER_SIGNATURE] => 
Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.28 Server at localhost Port 80


    [SERVER_SOFTWARE] => Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.28
    [SERVER_NAME] => localhost
    [SERVER_ADDR] => ::1
    [SERVER_PORT] => 80
    [REMOTE_ADDR] => ::1
    [DOCUMENT_ROOT] => C:/xampp/htdocs
    [REQUEST_SCHEME] => http
    [CONTEXT_PREFIX] => 
    [CONTEXT_DOCUMENT_ROOT] => C:/xampp/htdocs
    [SERVER_ADMIN] => postmaster@localhost
    [SCRIPT_FILENAME] => C:/xampp/htdocs/projeto_system/teste_servidor.php
    [REMOTE_PORT] => 50186
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => 
    [REQUEST_URI] => /projeto_system/teste_servidor.php
    [SCRIPT_NAME] => /projeto_system/teste_servidor.php
    [PHP_SELF] => /projeto_system/teste_servidor.php
    [REQUEST_TIME_FLOAT] => 1491829409.918
    [REQUEST_TIME] => 1491829409
)

Open in new window

Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
I am seeing this in the Doesn't Run dump

    [DOCUMENT_ROOT] => C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs

Open in new window


That doesn't match the path you have in the image you posted
C:/Arquivos de Programas (x86)/Apache Software Foundation/Apache2.2/htdocs

Open in new window

Eduardo FuerteDeveloper and Analyst

Author

Commented:
I guess this is caused by some kind of translation done by PHP...

It has the same meaning (portuguese/ english)

Obtained in the server

img005
Eduardo FuerteDeveloper and Analyst

Author

Commented:
Thanks.

It's a good start point.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial