Define a constant in PHP
Answer:
To define a constant in PHP, you can use define()
define ("PI", 3.1415);
echo PI;
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Define a constant in PHP
Answer:
To define a constant in PHP, you can use define()
define ("PI", 3.1415);
echo PI;
Repair table in MySQL
Answer:
If you are using the MyISAM storage engine, database might be corrupted when the computer was shutdown unexpectedly. To repair the table, you can use the following command in the MySQL client.
mysql> REPAIR TABLE my_table;
Convert string to integer in Python
Answer:
You can use the built-in int() type constructor, e.g.
int('123') == 123
Difference between die and exit in Perl?
Answer:
The main differences:
How to tell if Apache 2 is using prefork or worker MPM?
Answer:
If you are running in Red Hat Linux/ Fedora/ CentOS
# httpd -V
....
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
...
If you are running in Debian/ Ubuntu, you can use apache2 -V, which get the same output as above.