Welcome Guest, Not a member yet? Register   Sign In
load->view() not working?
#11

[eluser]jnorris441[/eluser]
I feel like a giant retard, not sure why this isn't working...

profile.php contains the gibberish text here

I commented out the model loading too, but I get the blank page.

I'm thinking my PHP is too old?
#12

[eluser]gtech[/eluser]
I tried this and it worked perfectly on my php5
Code:
<?php
    class Members extends Controller {
    
        function Members() {
            parent::Controller();
            //$this->load->model('Members_model');
        }


        function index() {
            $this->load->view('member/profile');
        }
    }
?>


Forgive me I havn't used php4 but I can think of things for you to try.


1) put some rubbish in your index function (like aaa) and see if you get an error message on the browser.. because you said you had configured E_ALL, at least then we know if error reporting is working.

2) put <?php at the start instead of <? see if that makes a difference, also check you have not got any spaces outside the angled braces.

3) check that the profile.php is in /views/member/profile.php

4) kick the computer.

4) upgrade to php 5 Smile
#13

[eluser]JamesD[/eluser]
[quote author="jnorris441" date="1195251032"]I feel like a giant retard, not sure why this isn't working...

profile.php contains the gibberish text here

I commented out the model loading too, but I get the blank page.

I'm thinking my PHP is too old?[/quote]

I'm with you jnorris441.

I've recently ran across a similar issue. Have been developing on PHP5 (I believe 5.2) and someone within my organization recompiled PHP 4.4.7 today without notifying me... and as a result my view templates are coming out blank.

All was fine until PHP was recompiled to 4+.

No errors or logging occurs during the '$this->load->view()' request.

Anyone else experience similar?

Thanks!
#14

[eluser]joeles[/eluser]
In my experience, blank pages in CI are almost caused by PHP throwing an error while display_errors is set to Off.

In your php.ini set:
Code:
display_errors = 1
display_startup_errors = 1

Or in your .htaccess:
Code:
php_value display_errors 1
php_value display_startup_errors 1

I hope this helps track down your problem.
#15

[eluser]JamesD[/eluser]
Oh... I've also attempted to kill it within the 'view' function of 'Loader.php', but it doesn't appear to ever make it that far.

If it helps, I am using UserAuth as well (version 0.9.2t52). I've checked, but haven't found any connection with this to the problem as of yet.

The only connection I've found so far is running on PHP4 as opposed to PHP5.

Currently Using:
- CI = 1.54
- UserAuth = 0.9.2t52
- Apache = 1.3.39
- Zend Engine v1.3.0
- ionCube PHP Loader v3.1.32
- Zend Extension Manager v1.2.0
- Zend Optimizer v3.3.0

Loaded Apache Modules:
Code:
mod_php4, mod_auth_passthrough, mod_log_bytes, mod_bwlimited, mod_security, mod_frontpage, mod_ssl, mod_setenvif, mod_so, mod_unique_id, mod_headers, mod_expires, mod_proxy, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core

Compiling config command used:
Code:
'./configure' '--enable-bcmath' '--enable-calendar' '--enable-discard-path' '--enable-ftp' '--enable-libxml' '--enable-magic-quotes' '--enable-sockets' '--prefix=/usr/local' '--with-apxs=/usr/local/apache/bin/apxs' '--with-curl=/opt/curlssl/' '--with-gd' '--with-jpeg-dir=/usr' '--with-libxml-dir=/opt/xml2/' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-zlib' '--with-zlib-dir=/usr'

(I'm not sure which libraries/mods were compiled previously)

Is it possible that Zend Optimizer could cause complications?

Side Note: Adding Zend Optimizer was "supposedly" the only change that I've been informed was made (or should have been made).
#16

[eluser]JamesD[/eluser]
[quote author="joeles" date="1197702014"]In my experience, blank pages in CI are almost caused by PHP throwing an error while display_errors is set to Off.

In your php.ini set:
Code:
display_errors = 1
display_startup_errors = 1

Or in your .htaccess:
Code:
php_value display_errors 1
php_value display_startup_errors 1

I hope this helps track down your problem.[/quote]

Thanks joeles.

It looks like the server is responding with HTTP status 304 instead of 200.

I'll need to dig more into this when I get more time and see what the core difference is between the PHP 4/5 GET headers and why it's behaving this way.

Right now I'm trying to "cheat" and have PHP 5 put back (my pref anyway).

Thanks again.
#17

[eluser]JamesD[/eluser]
It looks like it's possibly related to the CI reference probs in PHP4 (the super class)...

From 'Loader.php' line 1048:

Code:
function _ci_is_instance()
{
    if ($this->_ci_is_php5 == TRUE)
    {
        return TRUE;
    }

    global $CI;
    return (is_object($CI)) ? TRUE : FALSE;
}
#18

[eluser]JamesD[/eluser]
Ok, now I feel more stupid (umm... or should I say "stupider" - doh!). BUT, I did find the error of my ways!

The problem was caused from a reference/function name conflict and PHP 4 apparently doesn't know a good way to handle it or gets confused.

One of the controllers I use had the word 'view' in the function.... well, actually the controller was called 'view.php', placed in a sub-folder.
'application/controller/myfolder/view.php'

Once I changed the class & function names, and added a couple new routes (at least until I can change all refs in the code), I was back in business!

Haven't ran across any other issues yet, so that's a good sign. Wink

Hope this saves some time/aggravation for others.
#19

[eluser]coolfactor[/eluser]
Just a small observation... you had <? as your opening PHP tag. It's generally a good idea not to take that shortcut and use <?php instead. You'll achieve broader server compatibility.
#20

[eluser]lostsock[/eluser]
I too came across this problem while trying to test my app on PHP4 and as was said about the issue is caused by a conflict of names.

The user guide explains the issue and lists the reserve red names here: http://ellislab.com/codeigniter/user-gui...names.html




Theme © iAndrew 2016 - Forum software by © MyBB