php mysql update variable

Goal: Update wordpress post with PHP cli < ?php $con = mysql_connect("localhost","root","[redacted]"); if (!$con) { echo "Unable to connect to DB: " . mysql_error(); exit; } if (!mysql_select_db("wordpress")) { echo "Unable to select mydbname: " . mysql_error(); exit; } $myfileText = mysql_real_escape_string(file_get_contents('./code_for_wordpress.html',true)); $sql = "UPDATE `[your_instance_prefix]_posts` SET `post_content` = '$myfileText' WHERE `ID` like '1397';"; $result . . . → Read More: php mysql update variable

nginx php centos6 howto

Remove previous php installation

# yum remove php-cli php-common

Add the EPEL and REMI repos:

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

Install nginx prerequisites

# yum install perl pcre-devel gperftools-devel geoip geoip-devel

Download nginx

# wget “http://nginx.org/download/nginx-1.2.1.tar.gz”

Nginx configuration & installation:

# ./configure –prefix=/etc/nginx/ –sbin-path=/usr/sbin/nginx –conf-path=/etc/nginx/nginx.conf –error-log-path=/var/log/nginx/error.log –http-log-path=/var/log/nginx/access.log –pid-path=/var/run/nginx.pid –lock-path=/var/run/nginx.lock –http-client-body-temp-path=/var/cache/nginx/client_temp –http-proxy-temp-path=/var/cache/nginx/proxy_temp . . . → Read More: nginx php centos6 howto