2
votes

I developed a project in PHP 5.5 and it has a .htaccess file. My whole project works perfectly fine in windows 7. In Ubuntu 12.10, whenever i try to check my project, i get this error message.

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster. Error 404 localhost Apache/2.4.4 (Unix) OpenSSL/1.0.1e PHP/5.5.3 mod_perl/2.0.8-dev Perl/v5.16.3

My .htaccess file looks like this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

There are two types of files in Logs folder for errors:

Path: /opt/lampp/logs
error_log
php_error_log

error_log file contains this:

[Wed Oct 16 05:38:11.044023 2013] [ssl:warn] [pid 5479] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Oct 16 05:38:11.044087 2013] [ssl:warn] [pid 5479] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Oct 16 05:38:11.044110 2013] [suexec:notice] [pid 5479] AH01232: suEXEC mechanism enabled (wrapper: /opt/lampp/bin/suexec)
[Wed Oct 16 05:38:11.111342 2013] [auth_digest:notice] [pid 5480] AH01757: generating secret for digest authentication ...
[Wed Oct 16 05:38:12.041421 2013] [ssl:warn] [pid 5480] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Oct 16 05:38:12.041443 2013] [ssl:warn] [pid 5480] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Oct 16 05:38:12.041470 2013] [lbmethod_heartbeat:notice] [pid 5480] AH02282: No slotmem from mod_heartmonitor
[Wed Oct 16 05:38:12.047802 2013] [mpm_prefork:notice] [pid 5480] AH00163: Apache/2.4.4 (Unix) OpenSSL/1.0.1e PHP/5.5.3 mod_perl/2.0.8-dev Perl/v5.16.3 configured -- resuming normal operations
[Wed Oct 16 05:38:12.047835 2013] [core:notice] [pid 5480] AH00094: Command line: '/opt/lampp/bin/httpd -E /opt/lampp/logs/error_log -D SSL -D PHP'
[Wed Oct 16 05:41:38.971308 2013] [mpm_prefork:notice] [pid 5480] AH00169: caught SIGTERM, shutting down
[Mon Nov 11 05:36:18.038713 2013] [ssl:warn] [pid 5603] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Nov 11 05:36:18.050161 2013] [ssl:warn] [pid 5603] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Mon Nov 11 05:36:18.050220 2013] [suexec:notice] [pid 5603] AH01232: suEXEC mechanism enabled (wrapper: /opt/lampp/bin/suexec)
[Mon Nov 11 05:36:18.117059 2013] [auth_digest:notice] [pid 5604] AH01757: generating secret for digest authentication ...
[Mon Nov 11 05:36:19.135320 2013] [ssl:warn] [pid 5604] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Nov 11 05:36:19.135347 2013] [ssl:warn] [pid 5604] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Mon Nov 11 05:36:19.135377 2013] [lbmethod_heartbeat:notice] [pid 5604] AH02282: No slotmem from mod_heartmonitor
[Mon Nov 11 05:36:19.215465 2013] [mpm_prefork:notice] [pid 5604] AH00163: Apache/2.4.4 (Unix) OpenSSL/1.0.1e PHP/5.5.3 mod_perl/2.0.8-dev Perl/v5.16.3 configured -- resuming normal operations
[Mon Nov 11 05:36:19.215511 2013] [core:notice] [pid 5604] AH00094: Command line: '/opt/lampp/bin/httpd -E /opt/lampp/logs/error_log -D SSL -D PHP'

What is wrong with my settings? Please guide me.

2
What's in the error log?Maerlyn
If you remove this .htaccess and then try to access your site does it work?anubhava
I removed it also but got the same error. Object not found.d_4dinkey
Well that means you have config issue on Ubuntu.anubhava
@Maerlyn. please have a look. I have edited my question with error log.d_4dinkey

2 Answers

2
votes

If you're getting a 404 "Not found" error, then the problem is unlikely to be with your htaccess file itself, especially since you already tested it on another machine. An error in the htaccess itself would more likely give a 500 error.

The most likely problem here is that your filenames are not in the correct case.

Windows is case-insensitive, so for example Windows would a file named Index.PHP as being exactly the same file as index.php. However Linux is case-sensitive, so it would see them as two different files.

It's quite a common error for code developed on Windows and ported to Linux to have issues with the case of filenames.

Check your filenames; make sure everything is named consistently (I suggest all-lower-case), both in the way they're named and in how you're linking to them.

Hope that helps.

1
votes

Looks like you have SELinux enabled on your Ubuntu host. Try disabling it using one of the methods given in: http://www.thegeekstuff.com/2009/06/how-to-disable-selinux-redhat-fedora-debian-unix/