Welcome Guest, Not a member yet? Register   Sign In
Apache2 + CI
#1

[eluser]gh05t[/eluser]
Hi everybody,

I started developing a web application with CI about a week ago on localhost (XAMPP on Windows 7) everything was going great until I needed to use some UNIX commands so I migrated to VPS. I'm running on Ubuntu 10.04, Apache2. I've successfully installed Postfix and MySQL. It all has been tested and working.

The problem is when I try to visit my site the screen just goes blank. There's no error message neither from Apache nor from CI. It's just white. When I create a sample file with <?php echo 'ohai';?> it works fine, phpinfo() also works. Just can get CI working. I've changed base url in config, triple-checked .htaccess and I ran out of ideas.

Any help will be greatly appreciated.
#2

[eluser]pickupman[/eluser]
Welcome to the forums!
If you are trying to use a .htaccess file make sure you have a ? in your rule.
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

In your application/config/config.php bump your $config['log_threshold'] to 4, and reload the page. Then check in /system/logs for a file created on todays date. Also check in the index.php in your root for your error_reporting level
Code:
error_reporting(E_ALL); //This should display errors

Typically the blank screen is caused by a php error with error_reporting() turned off.
#3

[eluser]gh05t[/eluser]
Thank you for such a hasty response. I did all of the above, restarted apache - page is still blank. I'm seriously considering deploying a fresh copy of CI on the server and copying my code.
#4

[eluser]pickupman[/eluser]
You can try reuploading the system folder again. Have you check error reporting level in you php.ini file. Depending on server configuration, this may have to be edited in /etc/php5/apache2/php.ini.

What about file permissions as well. If you have downloaded in your home folder and extracted, then copied over to /var/www. Make sure that the files in /var/www have the correct permissions and ownership.
#5

[eluser]gh05t[/eluser]
I did the following thing: compressed the application to a single *.zip file on my machine (I don't fully trust FTP), uploaded it on the server, unzipped. Instead of putting it in root dir, I created a subdirectory. It works only in a subdirectory, I get 404 if I put it in root. Now the strange part: only the default controller works but nothing else, whenever I try to access any other controller I get 404.

It's not a permission issue, I went chmod -R 777 on the entire folder. Error reporting is enabled.
#6

[eluser]pickupman[/eluser]
chmod only makes is writable, but owned by you not apache (www-data). Try
Code:
cd /var/www
chown -R www-data:www-data *

This will change file ownership to apache's group. It may not be a bad idea to add your username to the www-data group.
#7

[eluser]gh05t[/eluser]
Still 404. *sigh*
#8

[eluser]pickupman[/eluser]
Is it an apache 404 or a CI 404? CI 404 has the red letters with the grey border.
#9

[eluser]gh05t[/eluser]
It's an Apache 404.

I'm going through apache2 configuration and logs, hoping I'll find something.
#10

[eluser]pickupman[/eluser]
I logged into my Ubuntu box and here is my /etc/apache2/sites-available/default
Code:
DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

Restart apache2 service.




Theme © iAndrew 2016 - Forum software by © MyBB