When I try to access the website I get this error:
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request
even after removing the htaccess file completely the website is still not working. NOTE: on localhost it's working fine.
Edit after comments:
I think I wasn't clear enough here's my problem in details:
I have a website written with PHP5 no framework or cms or anything and it work fine.
Then I start the admin section so I used CodeIgniter and rewrite the site.
Now I almost done with the programming so I uploaded a test version to the server in a subfolder to test it but the 500 error mentioned above appeared, my first thoughts were that it's a htaccess file problem so I try other htaccess files and finally removed it from the server, but the problem still there.
Now the only difference between my local server and the remote server is that locally i'm running PHP 5.3.5 and remotely it's PHP 5.2.14.
That's all the information that I can think of now.
Thanx in advance.
You likey have a missing PHP/Apache module hence the 500 error.
1: Check your logs within the root and the dir your running script in, else the directory above root/logs.
2: Create a file called phpinfo.php, in it put:
<?php phpinfo(); ?>
and run it.
3: Then compare the list of installed extensions shown in the output with the list of installed modules you have locally.
If your using WAMP, you click the tray icon, goto PHP->extentions and you can see all that are installed. Same for Apache.
boff
additionally:
A good start would to to make sure CURL and MBSTRING is on, however I don't use CAKE PHP....
I got same problem and added this line on top
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
Related
I am trying to use Grav CMS (https://getgrav.org/) on a Windows Server 2012 R2 with IIS. I unzip the grav core package and have moved it to my folder named grav in the following location: C:\inetpub\wwwroot\
When i try to launch the site i get the following message to come up:
This page isn't working
localhost is currently unable to handle this request.
http error 500
If i add a couple of echo outputs in the index.php file then i do get those to appear until the following lines of code that never seem to run and may be what is causing my issue:
// Process the page
try {
$grav->process();
} catch (\Exception $e) {
$grav->fireEvent('onFatalException', new Event(array('exception' =>
$e)));
throw $e;
}
This part seems to be what is causing the page to not load which i dont understand why it is doing so. I can make additional pages and put php code into them and i can render the page without issues.
I am at a loss right now because i made sure all the php modules are enabled and php is installed. I also installed php for IIS and made sure i did the URL rewrite for the htaccess file to a web.config file per the instructions.
Thank you very much for the help.
Figured it out. So I am using PHP 7 and found that a log gets created in the following location C:\Windows\Temp\PHP70x64_errors.log. Once I found that I found I had the following error message:
Uncaught RuntimeException: Opening file for writing failed on error in C:\inetpub\wwwroot\grav\vendor\rockettheme\toolbox\File\src\File.php:198
So this led me to look at the permission page on the Grav site and all of the fixes were for Linux and not Windows but this line caught my eye: The important thing to understand is that there is a potential issue if the user you use to edit your files on the file-system is different from the user that PHP runs under.
So I then needed to find out what user PHP was running under so I then created a test.php file and added the following:
<?php
echo exec('whoami');
?>
Which returned for me nt authority\iusr. So I then gave my whole Grav folder permissions for this user (probably could have just given it write) and voila it worked.
first I wish you a happy new year!
I got the following problem:
I receive an Internal Error 500 when trying to open one of my websites on my server which uses .php files. All Domains configured on this user don't work. The Domains configured on other users are working fine.
Checking out the error log gave me the error "Premature end of script". Until yesterday everything worked fine and I haven't made changes since than.
I checked out the following possibilities:
APC in php.ini -> doesn't exists in my php ini (https://www.drupal.org/node/213260)
File Permissions (500 Server error: Premature end of script headers:)
RLimitCPU and RLimitMEM
some other things with general configuration, but they can't be the reason because my other sites with php are working fine
I compared the Apache config of the different domains but couldn't find a relevant difference. Unluckily I changed the rights of the files in this directory and now my ftp isn't working anymore (set them to 705). Any Ideas on both problems?
Server is CentOS 6.7 with PHP 5.3.3 and Webmin Interface
FTP Server is ProFTPD
Thanks in advance!
I solved the problem with the premature end of script. The quota of the user was more than full, which was done by a failure in a cronjob. facepalm
i have php 5.3.1 installed on apache2 in ubuntu 12.04 server .
my site was working fine untill last week when i found some of the files were missing and website was not showing.I uploaded site again on server and now when i browse any php pages it shows a blank page and also when i try to see the source code in browser for the blank page it dosnt show any source code.the html files are all showing up.
i dont think it is the server or appache2 probelm as i have other site with php on the same server working fine.
i checked with php files they are alrite.checked with the htacces.txt and that is same as the other working site on the same server.
can anyone here help what the problem could be.
thanks
Rida
Check error logs in /var/log/apache2/error.log
I got the same problem while installing a third party LAMP application and the cause was missing php5-mysql package.
Hope this helps others.
Sometime this white screen may occur because of the php page that is included by include() and include_once() functions, which may have some error or any syntax error that are not reported by the php server.
This happens because the included php page are executed first before the actual php page and if any error that is present in the included file occurs that suppresses the error catching then further php codes are not executed and a blank page is displayed.
First try to find that which dependent file has the problem by // toggling each include() or includ_once() one at a time.
After the culprit dependent file is found try to check it for the errors.
In my case this happened when I un-installed Zend using its uninstall.sh, I then needed to edit the Apache config /etc/apache2/sites-enabled/000-default.conf to remove any references to Zend Server. I did restart Apache, but restarting the whole machine helped to revive PHP bindings.
In my case I find out that the include_once() function which I put on the top of the page was the problem . I red the answer by Gaurav Kispotta , that is where I got the tip . so if you have the same problem first comment that out , maybe even the entire code depending on that include .
You should never ever use require_once or include_once.
It will burst your server memory.
Just go with include or require.
php is a server side language so viewing source from browser will not yield any result if the whole codes are surrounded by php tags. Download the files from the server using an ftp client and try to open in an editor to see if there are still codes in it.
I have just moved a Wordpress install from a remote host to run on my local development machine. On the remote server it's fully functional.
However, on my development box I can only load the homepage. Other URLs just load a standard phpinfo() page with no errors.
Does anyone know what might be causing this?
It sounds like you are using MAMP or WAMP on your dev box, which will load a default vhost showing phpinfo for any page that does not exist.
Inside wordpress, the settings, in the DB, it sounds like you have Url's "hardcoded" like "http://www.mysite.com" which are not working locally because your "dev" Url is something like "http://localhost"
Whenever using a development server, especially with wordpress, you should setup you dev server as close to your production server. This means you should edit your host file to make it so "http://www.mysite.com" actually goes to your development box or localhost. That way you are viewing everything as it will be when it goes to production.
I had this problem as well following the hosting company re-installing an SSL certificate.
I did some searching and really only found this thread which give me the idea there was a 404 error hiding there somewhere so I checked the php_errors.log file (which I found in the root folder of my site in FTP) - opened that in notepad and found many errors such as:
PHP Fatal error: Class 'WordPressHTTPS_Module_phpinfo' not found in /var/www/vhosts/mywebsite.com.au/httpdocs/wp-content/plugins/wordpress-https/lib/Mvied/Plugin.php on line 385
So - indeed a missing file in the wordpress-https plugin.
To correct, I renamed the folder which contained that plugin (eg wp-content/plugins/wordpress-https to wp-content/plugins/wordpress-https-disabled) - effectively disabling the plugin.
This then allowed me to login to the wordpress admin, install the latest version of that plugin - which worked fine and then deleted the old folder (wordpress-https-disabled)
Everyting was good as gold after that
Hope that helps someone :)
open httpd.conf in text editor
Change;
AllowOveride none
To;
AllowOveride All
I had the same challenge when I cloned my remote site locally.
I fixed it by checking the .htaccess file and correcting this line to point to the right project folder:
RewriteRule . /wordpress/index.php [L]
I've just installed LAMP on my Ubuntu 9.10 machine, and everything works fine except when I copy my PHP files from another computer.
The LAMP guides I've followed also made me create a phpinfo() test file, which works, but when I try to type in e.g. index.php absolutely nothing happens - just a blank page in FireFox. :(
The files are in the exact same directory.
I'm thinking it's probably something with permissions and so on, but since I'm new to both PHP and Ubuntu, I'm kind of lost. It's like I can't create a PHP file with my file browser, but only by using the terminal - like when I created the testing.php from the LAMP guide.
Whaddayaknow... I made an error, tried to:
echo "Hello" world
which, even though I'm a PHP noob, I clearly know is wrong.
I think I'll have to figure out how to enable some sort of error reporting, a blank page is clearly not good enough.
You mean you have a index.php (copied from another computer) and a test.php (edited by hand, with a call to phpinfo()) in the same apache directory, the second works from your browser and the first doesnt ?
That can be a permission issue, or some compilation error in your php.
About permissions, for files should be readable from the apache server (more precisely, form the user that runs the apache server). You can type chmod a+r index.php.
YOu can also check your apache error logs (location dependent on installation). In any case it's vital to know where the error logs are if your are developing a web site.