Browsing articles from "September, 2010"
Sep
30
2010

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function

Getting this in a PHP site I am writing, to fix add this to a common include on your PHP page: date_default_timezone_set(‘UTC’);

Sep
30
2010

Show Errors in PHP using .htaccess

Simply add this to your .htaccess file to show errors in PHP, to surpress them simply change on to off # supress php errors php_flag display_startup_errors on php_flag display_errors on php_flag html_errors on

Sep
30
2010

Install APC on Fedora 13

To install APC simply enter in the following as root yum install php-pecl-apc

Sep
23
2010

Replace text in MSSQL row

I just had to do a bulk find and replace in MSSQL on a databsae to change PizzaExpress to Pizza Express. Instead of having to go into each one and change one by one I could just use the following SQL Query. Much faster! UPDATE restaurants SET restaurantName = REPLACE(restaurantName ,’PizzaExpress’,'Pizza Express’) WHERE restaurantName like ‘%PizzaExpress%’

Sep
21
2010

Autostart MySQL on CentOS

To start MySql Server automatically on a CentOS box simply issue the following command as root: chkconfig –levels 235 mysqld on You can also use this to autostart Apache: chkconfig –levels 235 httpd on

Sep
3
2010

Fatal error: Call to undefined function mysqli_connect()

Got this error when trying to use MySql in a PHP page on a Fedora install. What had happened is PHP wasn’t installed with MySql support. However it is simple to fix. Open up PuTTY and enter in the following: yum install php-mysql /sbin/service httpd restart

Sep
3
2010

Apache not using .htaccess

One common thing to happen when you have set up a new server with Apache and everything is realise all your rules in .htaccess are not working. This is usually to do with the AllowOverride Directive. By default this is set to None which means Apache will ignore all .htaccess files. Many people say that for best performance you shouldn’t use .htaccess files and instead put everything in the server configuration file, and from a [...]

Sep
3
2010

Virtual Host only showing Fedora Test Page

Fedora Test page

Setting up a Virtual Host in Apache, however although everything looked correct every time I hit the site I just got the Fedora Test page: I eventually found out that although my httpd.conf file was correct (shown below) permissions were set incorrectly on the web folder. To solve I granted 0777 permissions to the web folder and restarted Apache. All working again. httpd.conf <VirtualHost :80> ServerAdmin noemailhere@tech-problems.com ServerName www.tech-problems.com DocumentRoot /var/www/tech-problems/ ErrorLog logs/tech-problems-error_log CustomLog logs/tech-problems-access_log [...]

Sep
3
2010

HTML 5 Blank Page

Here is the code for a HTML 5 blank page <!DOCTYPE HTML> <html> <head> <meta charset=”utf-8″ /> <title>Untitled Document</title> </head> <body> </body> </html>

Sep
3
2010

Show my Fedora Version

To see what version of Fedora you have running (note this also works with CentOS and RedHat) issue the following command: cat /etc/redhat-release

Pages:12»