Tag Archives: PHP

Renew a SSL on AWS Linux

You might have ran into the problem where you can still buy a 3 year (or 2) SSL certificate, but you have to renew it each year. It's pretty simple still (assuming you know your way around SSH commands to your AWS instance). Generate your private key: sudo openssl genrsa -out server.keyOr if you have…
Read more

How to install PHP 7 and MySQL on EC2 Instance – Amazon

1. Install Apache 2.4 and PHP 7.0 on Amazon Linux AMI # Remove current apache & php (If you have installed a earlier version or you are having problems. Don't worry this WILL NOT remove any of your files, and it will make backup's of any config files you have). sudo yum remove httpd* php*…
Read more

Insert data into two tables of different databases on same instance

If both databases reside on the SAME MySQL server (and use the same user and password to connect). You simply establish the connection without picking a database, then put the name of the database in front of the table name like: INSERT INTO myDBname.myTableName (myKey) VALUES (myValue); If you have a connection to one database…
Read more

SSH zip only certain types of files recursively on Linux

If you are looking for a command to run via ssh that ZIPs all files (of a certain type) recursively here you go: 1 - Switch into the website folder, then run zip -R YOURZIPFILENAME '*.php' '*.html' '*.js' '*.css' 2 - You can also run this from outside the website folder: zip -r YOURZIPFILENAME website_folder…
Read more

AWS CLOSE_WAIT socket problems!

A buildup of sockets in CLOSE_WAIT state may indicate an application programming error. A CLOSE_WAIT socket is a socket in which the connection has received a FIN and has yet to be closed by the application. In this state, it is the responsibility of the application to close the socket, although the operating system will…
Read more

Go Daddy and PHP.ini file.

If you are using GoDaddy and hosting Linux with them, you may be needing to modify the PHP.ini configuration file. The PHP initialization files can manage form, server, and environmental variables as well as server-side cookies, temporary directories, error display, and error logging. First, you need to know how to modify it (or where to…
Read more

Transferring a WordPress Site

If you are needing to transfer an entire WordPress site (entire meaning EVERYTHING) than here is the plugin you need! https://wordpress.org/plugins/duplicator/ Install it, activate it. Go and make a backup/transfer of your entire site Upload the 2 files it creates, installer.php and the backup zip file to your new site Go to your new site…
Read more

How to update PHP to latest version on AWS EC2

Warning: Before doing anything, make backups!   Remove old versions of PHP and Apache The old Apache and PHP versions in the server can conflict with the new install. So it is recommended to stop the web server and remove them using the commands: sudo service httpd stop sudo service mysqld stop sudo yum remove httpd* php*…
Read more

jQuery Easy Countdown

If you're looking for an easy jQuery countdown timer, check this one out. Not much to say about it; A note on Date - the JavaScript Date constructor expects the year, month, and day as parameters. However, the month ranges from 0 to 11. To make explicit what date is intended (does a month of…
Read more

Check to see if MySQL record exists

If you have ever had script that you need to check before updating/deleteing a MySQL record here is a quick code to check: if(mysql_num_rows(mysql_query("SELECT userid FROM plus_signup WHERE id = '$userid'"))) { // Code inside if block if userid is already there }
Read more

Swapping Column Values in MySQL

If you ever need to swap column values in MySQL here is how: UPDATE TABLE s1, TABLE s2 SET s1.SWAP_A=s1.SWAP_B, s1.SWAP_B=s2.SWAP_A WHERE s1.KEY=s2.KEY Check out this article to read more.
Read more