Welcome Guest, Not a member yet? Register   Sign In
CI and blank php pages..
#1

[eluser]stevefink[/eluser]
Hi all,

With all of the CI installations I've ran on over 10 applications now, I've yet to run into something similar to this one. Essentially, my default controller is showing up blank on this environment which granted, I just installed PHP on. The code was checked out of a repository where I have everything perfectly running on a local sandbox.

Some things I double checked so that I'm not doing anything silly:

* appropriate PHP mime-types enabled.
* mod_rewrite module loaded
* php5 module loaded

All of my other PHP pages show up fine, just not my CI install. Nothing odd reported in Apache error logs, PHP error logs, or CI's log, and I have my threshold set to level 4.

I'm totally stumped. Anyone have any suggestions?
#2

[eluser]xwero[/eluser]
Have you enabled gzip?
#3

[eluser]stevefink[/eluser]
xwero:

config.php reads $config['compress_output'] = FALSE;
#4

[eluser]xwero[/eluser]
no so that is not the problem
#5

[eluser]xwero[/eluser]
what about echoing a string in a controller method
#6

[eluser]stevefink[/eluser]
Ok after some heavy digging with strace, I figured it out. Might be a good idea to post this somewhere for other folks who run into this issue.

I ran strace on Apache's root pid and made sure to capture all the forked child procs with the following:

vitamin-nybw tmp # strace -f -tt -o httpd.strace httpd -X

In another console I just watched httpd.strace for what happens after I send a GET request to the web server and the output looks like the following:

11933 16:22:51.106016 open("/www/builder/system/database/DB_active_rec.php", O_RDONLY) = 15
11933 16:22:51.106067 fstat(15, {st_mode=S_IFREG|0644, st_size=18235, ...}) = 0
11933 16:22:51.106127 read(15, "<?php if (!defined(\'BASEPATH\'))"..., 8192) = 8192
11933 16:22:51.106788 read(15, "c\r\n\t * @param\tstring\r\n\t * @param"..., 8192) = 8192
11933 16:22:51.107157 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aa0553000
11933 16:22:51.107580 read(15, " .= implode(\', \', $this->ar_orde"..., 8192) = 1851
11933 16:22:51.107625 read(15, "", 8192) = 0
11933 16:22:51.107889 close(15) = 0
11933 16:22:51.108031 open("/www/builder/system/database/drivers/mysql/mysql_driver.php", O_RDONLY) = 15
11933 16:22:51.108086 fstat(15, {st_mode=S_IFREG|0644, st_size=10918, ...}) = 0
11933 16:22:51.108155 read(15, "<?php if (!defined(\'BASEPATH\'))"..., 8192) = 8192
11933 16:22:51.108661 read(15, "------------\r\n\r\n\t/**\r\n\t * Escape"..., 8192) = 2726
11933 16:22:51.108707 read(15, "", 8192) = 0
11933 16:22:51.108990 close(15) = 0
11933 16:22:51.109098 chdir("/tmp") = 0

a close() system call was invoked followed by logging to apache's access log (too bad it's not clever enough to pick up issues like these in PHP or Apache error logs)

So I figured mysql_driver.php was the last file it read and errored out on, this is mysql related. I then realized that when I upgraded PHP today, I overlooked pointing PHP to the respective mysql client libraries. As a result, blank pages galore for CI. No apache errors, no php errors, no ci errors. Just blank pages.

Thank goodness for strace.

- sf
#7

[eluser]Derek Allard[/eluser]
wow, sweet work steve.




Theme © iAndrew 2016 - Forum software by © MyBB