Welcome Guest, Not a member yet? Register   Sign In
Library path problem
#1

[eluser]Wayne Smallman[/eluser]
Hi guys!

I've successfully loaded a library that's within the application/library folder, but this fails to load on the live website:
Code:
$uri_segment['client_id'] = $this->uri->segment(3);

        if (isset($uri_segment['client_id'])
            && ($uri_segment['client_id'] > 0)):

            if (file_exists(APPPATH . 'libraries/customers/' . $uri_segment['client_id'] . '/processing.php')):

                $this->load->library('customers/' . $uri_segment['client_id'] . '/processing');

            endif;

        endif;
The APPPATH constant is identical in each instance.

Specifically, it's the file_exists() function that's failing, and when I try visiting the file or file path, rather than get the obligatory 403 error, I'm getting a 404.

Any ideas what's happening?
#2

[eluser]LuckyFella73[/eluser]
The CI user guide says library filnames must be capitalized.
Try to name the file "Processing.php".

Maybe your develop server is a windows server and is not taking
care about case sesitive things?
#3

[eluser]John_Betong_002[/eluser]
The php function requires a complete path and APPPATH is not a complete path.

http://th.php.net/manual/en/function.file-exists.php

Try this:
Code:
if( file_exists( $_SERVER{'DOCUMENT_ROOT'} .....
 
#4

[eluser]Wayne Smallman[/eluser]
[quote author="LuckyFella73" date="1310760520"]The CI user guide says library filnames must be capitalized.
Try to name the file "Processing.php".

Maybe your develop server is a windows server and is not taking
care about case sesitive things?[/quote]Hi and thanks for the reply.

I'm using Linux, but the name was part of the problem.
#5

[eluser]Wayne Smallman[/eluser]
[quote author="John_Betong_002" date="1310761307"]The php function requires a complete path and APPPATH is not a complete path.

http://th.php.net/manual/en/function.file-exists.php

Try this:
Code:
if( file_exists( $_SERVER{'DOCUMENT_ROOT'} .....
 [/quote]Hi and thanks for the reply.

The problem was the lack of lead case.




Theme © iAndrew 2016 - Forum software by © MyBB