I've rent a vServer with ubuntu 20.04 and use plesk
When PHP errors happen, then no error log files are created in the log folder.
On my old vServer which has windows there wasn't such problem, the error file was created in log/php_errors/websitename/php_error.log but in linux nothing.
in the php.ini I have log_errors = on
I've seen several similar questions but they aren't helping
On my Linux server, using Plesk, the error logs are located in the logs directory, one directory up from the website root. So, something like
/var/www/vhosts/<domain.ext>/logs
Sometimes they don't immediately appear there, then they can also be found in:
/var/www/vhost/system/<domain.ext>/logs
I don't know why the logs initially don't appear in the first location.
Related
I'm having an issue where Xampp isn't logging my errors. The file path doesn't exist when I search for it. I read some stuff about this that said I need to enable php_error_log from the php.ini file but i don't know what values to change.
It should be a permissions issue (depending where you installed XAMPP). The XAMPP panel is sometimes unable to create the logs folder. Just create this directory:
...\xampp\php\logs
and the next time PHP error occurs it will create the php_error_log file inside and the logging will start.
I used to have a Windows OS server where i uploaded some old php web files to it. I could then access them, edit them, and view them online via my host name.
After much debating and reasoning, we had to change the OS of the server from Windows to Linux. After the change had been completed, a backup of the server was uploaded to the new Linux installation where all my old files were kept.
I could view these files online as I used to do when the server had windows OS.
The only thing I did encounter was the following:
a) I downloaded my files from the server using putty,
b) I deleted the old copy in my Linux server,
c) I then re-uploaded the same file that used to be in the server without making absolutely no change whatsoever to it, to the exact place where it was,
d) When I try to access it via its web address like I did earlier, it throws an error message saying..."The page isn't working".
I don't know much about Linux and there fore I am stuck. I don't know what the problem is. I can't understand why I can view all the files via their web address if they were placed there from the backup, but when I download them, delete their file from the server and then re-upload the exact same downloaded file to the exact place where it used to work, I get an error message.
Extra info: I connect to this Linux server from a windows OS machine using putty.
I found the problem. Since I migrated from a Windows OS server to a Linux Cent OS server, I didn't know that you had to configure the privileges of each folder in order to be accessed from the web. By default, my uploaded files where tagged by ownership of "user". The server was configured to only display files that were tagged by ownership of "root". The way I solved this was by typing the following command in the terminal.
NOTE: "You have to be in the folder where the file you are going to change ownership is."
sudo chown root:root filename.php
sudo -> Execute in admin mode
chown -> Change ownership of file to...
root:root -> ... root instead of user
filename.php -> the name of my file
Executing this corrected the error. Hope it helps someone else since I coudn't find anything related.
My PHP page is showing blank page when I try and run it on the server by calling the IP to the windows server and the directory to it, when I try and run HTML on the same server it works.
When I run it on Apache localhost it works perfectly as well!
Can someone tell me whats the problem?
yeah, check the apache logs! probably your error reporting is off, it might be setting in your php.ini file (you can run php --ini to see files being used if you have shell access to server), just remember, there might a separate php.ini file used for running php shell from with command and separate for when it's run through web, just remember, get the right php.ini - this will show you errors :) and then you can see whats wrong with your app... on a linux server logs should be in /var/logs/httpd(or apache2 depending on your version)
btw. check this one http://php.net/manual/en/function.error-reporting.php
I have configured Amazon EC2 Server and install PHP and MySQL. I have uploaded my website on it. it is in smarty.
Problem is when I update any .tpl file, then the server return white page as output in Firefox and Chrome return 500 Internal Server Error. I have surfed everywhere on internet but got nothing.
When I update any .php file then the code work nicely. problem is only with .tpl file.
I'm willing to bet that your templates_c directory is not writable by Apache (identified as apache or httpd, and you can check in your httpd.conf file), or it hasn't been configured correctly during Smarty initialization.
You can try temporarily setting your templates_c directory to 777 permissions to test this hypothesis.
If this ends up being the case, then you'll want to assign group ownership of templates_c to apache, and set the folder permissions to 775. (They explain this in their documentation.)
An HTTP status of 500, with no page content (Chrome is just being nice and rendering a default error message for you) means that PHP encountered a Fatal Error.
You will need to find out where PHP is configured to log to (usually a file called php_errors.log) and see what the error was.
Alternatively, you could temporarily allow PHP to output errors to screen, using the error_reporting setting.
My site frequently displays 500 Internal Server Error. Restarting apache, brings the site back to normal state. Other sites running on the same server does not have this issue. Apache error log have no information related to this. The apache loglevel of this site is set as "warn".
What may be the reason for this ?
My site is written on PHP and deployed in linux server.
If you have suphp installed it might be e permissions problem - if its installed all the files need to have chmod set to 644 and all thefolders - 755
Please check the folder necessary permissions. Then in index.php file add
ini_set('display_errors', 1);
to display error reports. So that you can find the error.