php mysql htaccess used for the first time - php

i am using the php and mysql to create a profile page using the get methode to get the username from the url like this (http://localhost/Unnamed%20Site%202/resources/username) so i used the .htaccess but the problem was that the root folder where i put the .htaccess was disappear and i get an error msg from the browser :
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin#localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
anyone can help me??
this is the appache_error.log
[Mon Mar 18 19:13:05 2013] [error] [client 127.0.0.1] PHP 1. {main}() C:\\wamp\\www\\Unnamed Site 2\\resources\\profile.php:0, referer: http://localhost/Unnamed%20Site%202/resources/
[Mon Mar 18 19:13:16 2013] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
[Mon Mar 18 19:13:21 2013] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
[Mon Mar 18 19:13:52 2013] [alert] [client 127.0.0.1] C:/wamp/www/Unnamed Site 2/resources/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/Unnamed%20Site%202/resources/account-setting.php
[Mon Mar 18 19:13:52 2013] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
[Mon Mar 18 19:23:09 2013] [alert] [client 127.0.0.1] C:/wamp/www/Unnamed Site 2/resources/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/Unnamed%20Site%202/resources/profile.php
[Mon Mar 18 19:23:09 2013] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
[Mon Mar 18 19:23:09 2013] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
[Mon Mar 18 19:23:11 2013] [alert] [client 127.0.0.1] C:/wamp/www/Unnamed Site 2/resources/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/Unnamed%20Site%202/
[Mon Mar 18 19:23:11 2013] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
[Mon Mar 18 19:23:12 2013] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
[Mon Mar 18 19:23:13 2013] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
[Mon Mar 18 19:23:14 2013] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
[Mon Mar 18 19:23:16 2013] [alert] [client 127.0.0.1] C:/wamp/www/Unnamed Site 2/resources/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/
[Mon Mar 18 19:23:16 2013] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://localhost/Unnamed%20Site%202/
[Mon Mar 18 19:23:16 2013] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://localhost/Unnamed%20Site%202/
[Mon Mar 18 19:23:16 2013] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://localhost/Unnamed%20Site%202/
[Mon Mar 18 19:23:16 2013] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://localhost/Unnamed%20Site%202/
[Mon Mar 18 19:23:16 2013] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://localhost/Unnamed%20Site%202/
[Mon Mar 18 19:23:16 2013] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
and this is the profile.php
// updatede for using the GET methode for ge the data nedded from the url
if(isset($_GET['u']))
{
$username = mysql_real_escape_string($_GET['u']);
if(ctype_alnum($username))
{
//check user exist
$check = mysql_query("SELECT user_name, first_name FROM user WHERE user_name = '$username' ")or die(mysql_error());
if (mysql_num_rows($check)==1)
{
$get = mysql_fetch_assoc($check);
$username = $get['user_name'];
$fname = $get['first_name'];
}
else
{
// this line is to redirect the unexist users to the index.php
echo "<meta http-equiv=\"refresh\" content=\"0; url=http://localhost/Unnamed Site 2/resources/index.php\">";
exit();
}
}
}
?>
.htaccess
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?u=$1 [L]

This error message
[Mon Mar 18 19:13:52 2013] [alert] [client 127.0.0.1] C:/wamp/www/Unnamed Site 2/resources/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/Unnamed%20Site%202/resources/account-setting.php
hints at a missing mod_rewrite module. You must first install and/or configure it, before you can use it.

Related

Apache server stopped working

I'm using Apache/2.2.16 (Debian) Server as a test server. It has stopped working. What I mean is whenever I try to access a page at say x.x.x.x/foo/bar.php my browsers status bar says waiting for x.x.x.x and the server never responds.
This is what the error logs at says:
[Thu Jun 25 11:30:22 2015] [error] [client 94.200.27.10] PHP Parse error: syntax error, unexpected T_STRING in /usr/share/drupal6/abdi-test/index.php on line 28
[Thu Jun 25 11:30:59 2015] [error] [client 94.200.27.10] PHP Parse error: syntax error, unexpected T_STRING in /usr/share/drupal6/abdi-test/index.php on line 28
[Thu Jun 25 11:31:20 2015] [error] [client 94.200.27.10] PHP Fatal error: Call to undefined method DbConnector::dbQuery() in /usr/share/drupal6/abdi-test/index.php on line 31
[Thu Jun 25 11:57:41 2015] [error] [client 94.200.27.10] Directory index forbidden by Options directive: /usr/share/drupal6/abdi-test/
[Thu Jun 25 11:59:03 2015] [error] [client 94.200.27.10] Directory index forbidden by Options directive: /usr/share/drupal6/abdi-test/
[Thu Jun 25 12:15:33 2015] [error] [client 94.200.27.10] Directory index forbidden by Options directive: /usr/share/drupal6/abdi-test/
[Thu Jun 25 12:31:56 2015] [error] [client 94.200.27.10] Directory index forbidden by Options directive: /usr/share/drupal6/abdi-test/
[Thu Jun 25 12:49:47 2015] [error] [client 94.200.27.10] Directory index forbidden by Options directive: /usr/share/drupal6/abdi-test/
[Thu Jun 25 12:50:15 2015] [error] [client 151.80.123.208] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:)
[Thu Jun 25 12:56:29 2015] [error] [client 94.200.27.10] Directory index forbidden by Options directive: /usr/share/drupal6/abdi-test/
I'm just an intern so I only have ftp access to this test server. My supervisor says there is a problem with the code on one of the pages somewhere on the server but he's too busy with something else to fix it right now.
Does anyone know what might be wrong?

website not working after moving from local to the server

am using codeigniter 2.2 and my os is ubuntu 14.04 . I have developed a website using codeigniter on my localhost. it was working fine.
now i have moved the site to the real server http://hotlunchorders.com/. i am getting the error.
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster#hotlunchorders.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
my .htaccess file
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
errorlog file in server
[Thu Jun 04 08:00:35 2015] [error] [client 67.213.90.137] SoftException in Application.cpp:256: File "/home/hotlunchorders/public_html/index.php" is writeable by group
[Thu Jun 04 08:00:35 2015] [error] [client 67.213.90.137] SoftException in Application.cpp:256: File "/home/hotlunchorders/public_html/index.php" is writeable by group
[Thu Jun 04 07:59:57 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/404.shtml, referer: http://hotlunchorders.com/beta/index.php/profile/index
[Thu Jun 04 07:59:57 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/beta/assets/css/global-style-color-icon.css, referer: http://hotlunchorders.com/beta/index.php/profile/index
[Thu Jun 04 07:59:54 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/404.shtml, referer: http://hotlunchorders.com/beta/index.php/home/index
[Thu Jun 04 07:59:54 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/beta/assets/css/global-style-color-icon.css, referer: http://hotlunchorders.com/beta/index.php/home/index
[Thu Jun 04 07:59:49 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/404.shtml, referer: http://hotlunchorders.com/beta/index.php/order/step4/cod
[Thu Jun 04 07:59:49 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/beta/assets/css/global-style-color-icon.css, referer: http://hotlunchorders.com/beta/index.php/order/step4/cod
[Thu Jun 04 07:59:42 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/404.shtml, referer: http://hotlunchorders.com/beta/index.php/order/step3
[Thu Jun 04 07:59:42 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/beta/assets/css/global-style-color-icon.css, referer: http://hotlunchorders.com/beta/index.php/order/step3
[Thu Jun 04 07:59:30 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/404.shtml, referer: http://hotlunchorders.com/beta/index.php/order/step2
[Thu Jun 04 07:59:30 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/beta/assets/css/global-style-color-icon.css, referer: http://hotlunchorders.com/beta/index.php/order/step2
[Thu Jun 04 07:59:26 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/404.shtml, referer: http://hotlunchorders.com/beta/index.php/order/step1
[Thu Jun 04 07:59:26 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/beta/assets/css/global-style-color-icon.css, referer: http://hotlunchorders.com/beta/index.php/order/step1
[Thu Jun 04 07:58:07 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/500.shtml
[Thu Jun 04 07:58:07 2015] [error] [client 67.213.90.137] SoftException in Application.cpp:256: File "/home/hotlunchorders/public_html/index.php" is writeable by group
[Thu Jun 04 07:58:05 2015] [error] [client 67.213.90.137] File does not exist: /home/hotlunchorders/public_html/404.shtml, referer: http://hotlunchorders.com/beta/index.php/profile/index
Can someone help me to fix this problem. tnx.
Points to look at:
Is rewrite module enabled? Enable by sudo a2enmod rewrite.
Are paths correct? Linux is case sensitive.
is writeable by group may point out the permission problems. Try changing permission set to sudo chmod 0750 respective files and directories.

Magento mass reindexing gives internal server error

How can we reindex a Magento 1.7.02 version site having more than 24,000 products and hundreds of categories?
When I try to reindex the product price index in Magento Admin Index Management, it generates an internal Server Error 500. When I checked the server log for errors it shows up with messages:
home2/mysitete/public_html/403.shtml
[Wed Jun 04 22:15:03 2014] [error] [client 101.0.79.114] client denied by server configuration: /home2/mysitete/public_html/ultimate4wheel/app/etc/local.xml
[Wed Jun 04 22:14:37 2014] [error] [client 202.191.65.162] File does not exist: /home2/mysitete/public_html/404.shtml
[Wed Jun 04 22:14:37 2014] [error] [client 202.191.65.162] File does not exist: /home2/mysitete/public_html/favicon.ico
[Wed Jun 04 22:14:36 2014] [error] [client 202.191.65.162] File does not exist: /home2/mysitete/public_html/500.shtml, referer: http://mysitetest.com.au/ultimate4wheel/index.php/admin/process/edit/process/4/key/e7cfe1aaf5b456e018f28e488e42a4bd/
[Wed Jun 04 22:13:51 2014] [error] [client 101.0.79.114] File does not exist: /home2/mysitete/public_html/403.shtml
[Wed Jun 04 22:13:51 2014] [error] [client 101.0.79.114] client denied by server configuration: /home2/mysitete/public_html/ultimate4wheel/app/etc/local.xml
[Wed Jun 04 22:13:48 2014] [error] [client 101.0.79.114] File does not exist: /home2/mysitete/public_html/403.shtml
[Wed Jun 04 22:13:48 2014] [error] [client 101.0.79.114] client denied by server configuration: /home2/mysitete/public_html/ultimate4wheel/app/etc/local.xml
[Wed Jun 04 22:13:43 2014] [error] [client 101.0.79.114] File does not exist: /home2/mysitete/public_html/403.shtml
[Wed Jun 04 22:13:43 2014] [error] [client 101.0.79.114] client denied by server configuration: /home2/mysitete/public_html/ultimate4wheel/app/etc/local.xml
[Wed Jun 04 22:13:35 2014] [error] [client 101.0.79.114] File does not exist: /home2/mysitete/public_html/403.shtml
[Wed Jun 04 22:13:35 2014] [error] [client 101.0.79.114] client denied by server configuration: /home2/mysitete/public_html/ultimate4wheel/app/etc/local.xml
[Wed Jun 04 22:13:21 2014] [error] [client 101.0.79.114] File does not exist: /home2/mysitete/public_html/403.shtml
[Wed Jun 04 22:13:21 2014] [error] [client 101.0.79.114] client denied by server configuration: /home2/mysitete/public_html/ultimate4wheel/app/etc/local.xml
[Wed Jun 04 22:12:06 2014] [error] [client 101.0.79.114] File does not exist: /home2/mysitete/public_html/403.sht
Can anyone help me to solve it... or reindex correctly?
I have also tried increasing time limit, memory limit, skipping security, etc. but didn't work as I wrote in .htaccess file:
php_value memory_limit 2836M
php_value max_execution_time 2592000
php_value max_input_time 2592000
php_value session.gc_maxlifetime 864000
php_value session.cookie_lifetime 864000
php_value max_input_vars 50000
For mass re-indexing you should always try command prompt.
Go to your project path through command line:
cd path/to/your/project/folder
And then open "Shell" folder
cd shell
And then do the following command to re-index all indexes.
php indexer.php --reindexall
For more info go through this link.
Magento link

Many File does not exist in Cpanel error log

I have so many errors with file does not exist in CPanel error log. I've tried all the methods founded here but no luck. Below is a sample of my error log:
[Tue Apr 29 09:28:12 2014] [error] [client 69.171.245.119] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:12 2014] [error] [client 69.171.245.119] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.118] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.118] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.114] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.118] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.117] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.112] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.116] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.114] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.117] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.113] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.115] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.116] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.117] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.112] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.115] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.117] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 69.171.245.113] File does not exist: /home/.../public_html/politic
[Tue Apr 29 09:28:11 2014] [error] [client 66.249.70.173] File does not exist: /home/.../public_html/tags
[Tue Apr 29 09:28:11 2014] [error] [client 31.13.99.114] File does not exist: /home/.../public_html/politic
Please, give me a hand! The problem is that all file does not exist links are actually categories in site or articles in site.
Have you checked if permissions are correctly set on folders, the folder should exist with same name (dont forget caps etc.) and cpanel require correct file and folder permissions, the file permissions bits should not be more than 644 and folder permission bits should not be more than 755.

Any of my php files on the server generated 500 "Internal Server Error"

Everything was working fine till last morning (12 hours ago). But now each of PHP page is showing "500 Internal Server Error". Please look at this link http://abusadat.com. It's an WordPress site. I have thought it's about WordPress.
But I have a sub-domain, where there is a single PHP file - http://demo.abusadat.com/fb-apps/index.php, which gets same error. Though at the same location, there is a HTML file http://demo.abusadat.com/fb-apps/test.html, which works fine. To test if any syntax in PHP page causes that error, I have placed a "die('some message')" at the first line of that "index.php" file, but it shows same error. There is no HTAccess in that sub-domain.
Everything was working - suddenly all PHP stopped, I can't get the problem. Can anyone help?
Edited:
*Latest Error log from cPanel*
[Mon Jun 27 14:42:30 2011] [error] [client 59.93.241.43] File does not exist: /home/abusadat/public_html/demo.abusadat/404.shtml
[Mon Jun 27 14:42:30 2011] [error] [client 59.93.241.43] File does not exist: /home/abusadat/public_html/demo.abusadat/favicon.ico
[Mon Jun 27 14:42:29 2011] [error] [client 59.93.241.43] File does not exist: /home/abusadat/public_html/demo.abusadat/404.shtml
[Mon Jun 27 14:42:29 2011] [error] [client 59.93.241.43] File does not exist: /home/abusadat/public_html/demo.abusadat/favicon.ico
[Mon Jun 27 14:42:26 2011] [error] [client 59.93.241.43] File does not exist: /home/abusadat/public_html/demo.abusadat/404.shtml
[Mon Jun 27 14:42:26 2011] [error] [client 59.93.241.43] File does not exist: /home/abusadat/public_html/demo.abusadat/favicon.ico
[Mon Jun 27 14:40:53 2011] [error] [client 70.176.105.10] File does not exist: /home/abusadat/public_html/demo.abusadat/404.shtml
[Mon Jun 27 14:40:53 2011] [error] [client 70.176.105.10] File does not exist: /home/abusadat/public_html/demo.abusadat/favicon.ico
[Mon Jun 27 14:40:53 2011] [error] [client 70.176.105.10] File does not exist: /home/abusadat/public_html/demo.abusadat/404.shtml
[Mon Jun 27 14:40:53 2011] [error] [client 70.176.105.10] File does not exist: /home/abusadat/public_html/demo.abusadat/favicon.ico
[Mon Jun 27 14:40:53 2011] [error] [client 70.176.105.10] File does not exist: /home/abusadat/public_html/demo.abusadat/500.shtml, referer: http://stackoverflow.com/questions/6497358/any-of-my-php-files-on-the-server-generated-500-internal-server-error
[Mon Jun 27 14:40:00 2011] [error] [client 180.234.41.26] File does not exist: /home/abusadat/public_html/demo.abusadat/500.shtml
[Mon Jun 27 14:39:48 2011] [error] [client 180.234.41.26] File does not exist: /home/abusadat/public_html/demo.abusadat/404.shtml
[Mon Jun 27 14:39:48 2011] [error] [client 180.234.41.26] File does not exist: /home/abusadat/public_html/demo.abusadat/fb-app
[Mon Jun 27 14:39:34 2011] [error] [client 109.132.111.25] File does not exist: /home/abusadat/public_html/demo.abusadat/404.shtml
[Mon Jun 27 14:39:34 2011] [error] [client 109.132.111.25] File does not exist: /home/abusadat/public_html/demo.abusadat/favicon.ico
Thanks,
Sadat
You should check your log files to determine if an automatic update occurred around the time the problem first appeared. Also check if Apache (or your web server) was restarted around that time, activating a previous update.

Categories