Turn off PHP error messages?
Answer:
In a production server, you should always turn off PHP error messages to be displayed for public, to do so, edit the php.ini
E.g.
vi /etc/php.ini
And turn off display_errors
display_errors = Off
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Turn off PHP error messages?
Answer:
In a production server, you should always turn off PHP error messages to be displayed for public, to do so, edit the php.ini
E.g.
vi /etc/php.ini
And turn off display_errors
display_errors = Off
How to perform checksum on a file?
Answer:
You can use the md5sum or shasum commands.
Example
#md5sum test.txt
f1d41356dcabb8d8acefed069b22b0da test.txt
#shasum test.txt
809970aec0109c5464dd36a3a9a5a9e79f838313 test.txt
md5sum is faster if you perform the command on a very large file, but shasum is more secure since the chance of two different files have the same checksum is smaller.
References:
How to avoid SQL injection in PHP?
Answer:
The easiest method is to use the mysql_real_escape_string function
Example:
$query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'",
mysql_real_escape_string($user),
mysql_real_escape_string($password));
Reference: http://php.net/manual/en/function.mysql-real-escape-string.php
Should I use Telnet and FTP for remote access?
Answer:
In a word, No.
The problem with Telnet, FTP, and other non-encrypted protocols is that everything is sent across the network as plain text. This means that someone running a sniffing program on the network, which is very simple under many circumstances, can see all of your traffic - including your login and password.
Consider replacing Telnet and FTP with SSh.
How do I set up a firewall under Linux?
Answer:
In Linux, IPTables is the default firewall for kernels 2.4 and above.
IPTables is quite a complicated software which cannot be explained in just a few words, please refer to a more comprehensive howto: