Running a Python script from PHP

Tested on Ubuntu Server 10.04. I hope it helps you also on Arch Linux. In PHP use shell_exec function: Execute command via shell and return the complete output as a string. It returns the output from the executed command or NULL if an error occurred or the command produces no output. Into Python file test.py, verify this … Read more

PHP get domain name

Similar question has been asked in stackoverflow before. See here: PHP $_SERVER[‘HTTP_HOST’] vs. $_SERVER[‘SERVER_NAME’], am I understanding the man pages correctly? Also see this article: http://shiflett.org/blog/2006/mar/server-name-versus-http-host Recommended using HTTP_HOST, and falling back on SERVER_NAME only if HTTP_HOST was not set. He said that SERVER_NAME could be unreliable on the server for a variety of reasons, including: no … Read more

nginx: connect() failed (111: Connection refused) while connecting to upstream – after update nginx –

After many hours trying to find the source of the problem (many install and purge) The problem was, for me, the use of different port “name” in nginx and php. in php (/etc/php/8.0/fpm/pool.d/bienestarmutuo-org8050.conf) i have in nginx (/etc/nginx/sites-available/bienestarmutuo.org.conf) i have This was changed to: in nginx in php restart php and nginx, everything Work again. … Read more

Can’t use method return value in write context

empty() needs to access the value by reference (in order to check whether that reference points to something that exists), and PHP before 5.5 didn’t support references to temporary values returned from functions. However, the real problem you have is that you use empty() at all, mistakenly believing that “empty” value is any different from … Read more

WordPress child theme style.css not working

Take a look at your <head> tag. More importantly look at the order of your stylesheets. The styles from your child theme are being added first and then all the styles from your parent theme. This will cause the styles from the parent theme to override your child theme styles. You can change the priority … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)