Internal Server Error apache issue - php

I've got a strange problem while trying to add pages to my website.
I'm actually trying to create a "test.php" in my directory, but when I try to access it, I've got
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, contact#mywebsite.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.
My .htaccess looks like this :
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.mywebsite\.com [NC]
RewriteRule (.*) http://mywebsite.com/$1 [R=301,L]

Ok now according to your error you posted it appears to be like a ownership issue. chown your web directory from the command line and see what happens.
chown -R apache: /home/krokoweb/public_html/
Note I used the user "apache" as example. Use whatever your web user is for your files. e.g. www-data, apache, httpd etc
See how that works out.

Related

Semantic URL with .htaccess (Error 500)

I want to semantic my website URL, but when I want to show result I have a 500 Error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin#example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 80
The .htaccess code
RewriteEngine on
RewriteCond %{REQUEST_URI} 10/
RewriteRule 10/ http://localhost/Cnxkhamsat/admin/edit.php?chi_id=10
Any help ?
The code appears to work fine when trying on a local machine, meaning there are no syntax errors.
The most likely scenario is that you do not have the appropriate permissions to use the RewriteEngine. This usually happens when using a shared hosting, or sometimes VPS.
If you have access to your httpd.conf file you can most likely turn the RewriteEngine on from there. If you don't have access to it, then you'll likely need to contact your hosting provider and tell them that you need them to allow you to use the rewrite engine.

500 Internal Server Error with Wamp server

I've created a web service using php, slim and mysql but when I try to access the urls it gives me "The server encountered an internal error or misconfiguration and was unable to complete your request."
When I check the log it gives me :
C:/wamp/www/task_manager/.htaccess: Invalid command '.htaccess', perhaps misspelled or defined by a module not included in the server configuration
I checked few things online and I can ensure you that rewrite_module is installed and activated (not commented in the http.config
does anyone know how to fix that?
I ll attach the content of my .htaccess
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ %{ENV:BASE}index.php [QSA,L]
Remove the line .htaccess from your .htaccess file.
if you install new wamp on your system,
and you are using htaccess in your project to rewrite some urls first you need:
Click on wamp icon and Go to "Apache" Then Click on "Apache Modules"
and make sure your RE WRITE extension should be checked.

Getting an error when I visit http://localhost

I am trying to access localhost on my xampp via the Chrome browser but 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
Apache and MySQL are turned on so I don't understand.
You can access "localhost" just fine.
The "404: file not found" error indicates the server can't find the requested file once you've connected to localhost.
ADDENDUM:
Maybe try to create a regular html file called test.html in one of
your vhosts that is not working. Then try to visit that url. That
should give you some clue as to what may be the problem. – Gohn67
This is good advice. Try it. Specifically:
1) Create the following five files:
C:/xampp/htdocs/dummy-host.localhost/test.html
C:/xampp/htdocs/my/test.html
C:/xampp/htdocs/launcher/public_html/test.html
C:/xampp/htdocs/website/httpdocs/test.html
C:/xampp/htdocs/my/test.html
2) Make sure each of these directories exist, and each has a "test.html" with the words "TESTING 1...2...3" in it
3) Try each of these five URLs in your browser:
http://localhost/test.html
http://itutormaths.web/test.html
http://itutormaths.mod/test.html
http://itutormaths.hub/test.html
http://my.itm/test.html
4) Report back the exact error you get from each browser URL
Navigate here:
http://localhost/
If that works, everything is okay.
Paste wordpress to xampp/htdocs, and you should not get any error.
I had a similar issue and this is how I resolved it:
Open the httpd:conf file on the Apache module in XAMPP (click the Congif button)
Scroll through the file - after the first set of comments (#) there is a line of code which says 'Listen 80'. Change this to 81 (or whatever other port you want to use).
Open web browser and explicitly define the port in the web address:
127.0.0.1:81
The may or may work for you; I initially had the issue that Apache wouldn't start at all, which is why I changed the port number (couldn't be bothered to figure out which service was using port 80 - if you want to you can use the command netstats -a or netstats -b in command prompt to figure it out)
Hope this helps
I just encountered this and solve this by creating .htaccess file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /yourfoldername/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

zend project on shared hosting?

I created a zend project on localhost on ubuntu OS and it is working perfectly on my local system. Now I want to upload this project online. I purchased domain name and hosting. I got following directory structure to upload files.
/www.example.com/web/content/
So www.example.com is pointing to /www.example.com/web/content/ folder. This directory structure is unchangeable. I put all public folder files to /www.example.com/web/content/ and application, library and tests folders into /www.example.com/web/. So it is the same directory as my local system but only public folder is renamed to content folder.
Now homepage is successfully shown but whenver I click any link or redirect to any other webpage, I got following error.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root#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.
Apache/2.2 Server at example.com Port 80
Any idea ?
Thanks
Internal server (HTTP 500) errors can occur for many reasons. You should check your web server's error log for more details. If you don't have access to your vhosts' error log, ask your host to see what's going wrong.
It is solved after reading following thread:
http://www.zfforums.com/zend-framework-general-discussions-1/installation-configuration-3/problems-1and1-hosting-560.html
So it is working using following .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

all php pages give Internal Server Error

Since it's a friday, I can't ask my host about this, but apparently, all the .php pages on my websites are giving out the "Internal Server Error"... this started just now, I was not on my admin cp, I did 0 changes to my website today, in fact, I changed nothing for about a week now.
I host a few forums and got alerted by some users just now who were browsing and suddenly this happens.
The website in question:
cudamine.com
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, xxx#email.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 404 Not Found error
was encountered while trying to use an
ErrorDocument to handle the request.
I use cPanel X.
Should I be worried about this? Some sort of attack or something? All HTML pages work fine, it's just .php that seems to have this issue, is this a problem on my hosts end, or can I do anything about this before monday? Thanks guys, and sorry if this is the wrong place to ask. It's just that I don't want to have no site for the whole weekend...
After reading up on the web about similar situations, I found some info on the .htaccess file, I found the file and this is what's in it:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^cudamine.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.cudamine.com$
RewriteRule ^santa\-maria\/forum\/?(.*)$ "http\:\/\/cudamine\.com\/santa\-maria\/\?page_id\=7\/$1" [R=301,L]
Those two RewriteCond are 2 of my links that use php... I tried deleting this file, nothing changed though.
Definitely check the error log (should be available in CPanel).
One common occurrence I see is when a host enables SuPHP (suexec for PHP scripts) and you have group writable scripts or directories containing scripts.
If your error log shows anything like "Apache SoftException", then this is the most likely cause. You need to change the filesystem permissions on your scripts and directories to remove the group "write" bit.
Another possible cause is your host has disabled mod_rewrite or removed the appropriate overrides (FileInfo) to use the Rewrite* directives.
PHP may be writing its error log elsewhere than the standard Apache error_log. You can retrieve the log's location with ini_get('error_log'). If the value's something other than "syslog", PHP is writing its errors to a file of the same name.

Categories