Paul's Programming Notes     Archive     Feed     Github

PHP Best Practices

https://phpbestpractices.org/

Things I learned:

  • It's easy to install PHP-APC for quick opcode caching, and it apparently serves the same purpose as memcached for a single server.
  • Memcache and Memcached are two different libraries.
  • There's a different (a small one) in speed between single and double quotes.
  • Use phpass to store passwords.

Set Up Wordpress For FTP

If it's asking you for FTP login information when you try to update wordpress or a plugin, you don't need to do that! Chances are you don't have permissions correctly configured on that directory. Make sure apache owns the directory. On ubuntu, this will probably work (depending on which user owns apache):

sudo chown -R www-data:www-data /var/www

Bootstrap Span Is Overlapping

Try setting a static width on the span. This ensures responsive knows when to put it on another line. It solved my issues with the spans overlapping.

example: add style="width: 520px" to your div with class="span6"


mysql-client 5.6 or phpmyadmin for mysql 5.6

Mysql-client 5.6 doesn't seem to exist, and you don't need it. Phpmyadmin installs mysql-client 5.5 automatically, and that works with mysql server 5.6. If you're having issues, you probably need to run "sudo dpkg-reconfigure phpmyadmin".

Turn Off MySQL Strict Mode

http://nickbartlett.com/wordpress/how-to-turn-off-mysql-strict-mode/

SET @@global.sql_mode= ”; will set it temporarily. (to see if it will fix your problem)

To turn it off permanently, add this setting to your my.cnf (probably in /etc/mysql/my.cnf if you're using ubuntu): 
[mysqld]
sql-mode =


If you're having issues getting this setting to work in your my.cnf, look for another my.cnf in /opt/mysql/server-5.6/my.cnf or elsewhere on your system using the "find / -name 'my.cnf'" command.

error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

sudo apt-get install python-dev

Running that command on ubuntu will fix the issue.

If you're installing lxml:


Also try this:
sudo apt-get install libxslt1-dev libxslt1.1 libxml2-dev libxml2 libssl-dev