Monday, June 7, 2021

How to find out if curl is enabled for PHP on your web server?

 https://www.discussdesk.com/how-to-install-curl-and-check-curl-is-enabled-in-web-server.htm

1. phpinfo

curl

cURL support     enabled
cURL Information     7.54.0         
 
 

2. Verify through PHP code


 if (in_array ('curl', get_loaded_extensions())) {

echo "CURL is available on your web server";

} else {
echo "CURL is not available on your web server";
}    















How to find the extensions directory for PHP?

phpconfig

bash-3.2# php-config --extension-dir
/usr/lib/php/extensions/<foldername>

Sunday, May 2, 2021

How to find the executable path of a php,mysql program? - Try which and whereis

You may want to find out where the executable is installed or is being executed from

which php

/usr/php


which mysql

/usr/local/mysql/bin/mysql

 

Alternative command for the same results as above.

whereis php

whereis mysql

echo "">access_log How to clear a log file without deleting it?

 Do you want to debug a file and realize it has too much of content in it.

Let's say the file name is access_log.

just say echo "">access_log.

This will replace the content with the blank file.

Now your file is ready to starting logging data from now :-).

Note: Please use this at your own discretion. This is just a workaround.