Browsing articles in "Technical"

Sendmail on Ubuntu

Install Sendmail on Ubuntu

I also need my php applications to be able to send our email using the mail function. Therefore I need to install sendmail and enable it in my php.ini file.
Install Sendmail

apt-get install sendmail

Check its working

ps -aux | grep sendmail

Change php.ini

replace
;sendmail_path =
with
sendmail_path =  /usr/sbin/sendmail

Config Sendmail

sudo sendmailconfig

Change your host files

homename
/etc/hosts
127.0.0.1 localhost.localdomain localhost myhostname

Adobe Air with Netbeans

I love Netbeans, it’s by far my favourite IDE for developing PHP applications. Recently, I’ve needed to create an Adobe Air application and from what I remember the best free IDE on windows for this was Aptana, which is ok however I found it a little slow (and I already know all the Netbeans shortcuts). So what I really wanted to do was developed Adobe Air with Netbeans, and you can…

The video below shows you step by step however it’s 5 minutes long and I can explain in 5 lines.

  1. Download the Adobe Air SDK, unzip.
  2. Open Netbenas, Create a new PHP Project
  3. On the 3rd page of creating a new project (Run Configuration) choose Run As: Script (run in command line)
  4. Then choose AdobeAIRSDK\bin\adle.exe as the PHP Interpreter
  5. The final step which isn’t in the video, (after creating the index.html file and application.xml file) click the Run Project button and it will ask you for Run Configuration, makes sure you choose application.xml as the Index File NOT index.html.

Hopefully this will work for you as well!

Best Firefox Plugins for SEO aka Addons

Probably the best browser for SEO and Web Development (although prefer Chrome for surfing the net). This is mainly because of the wide variety of addons/plugins available.

Recommended Addons for SEO:

  • Firebug
  • Page Speed
  • SEOQuake
  • SEO For Firefox
  • Google Toolbar (for page rank – doesn’t work on FF7+)
  • Search Status
  • SEOMoz Toolbar
  • User Agent Switcher
If you have any other suggestions and I’ll add them to the list.

Setup Ubuntu as a Web Server

So these are the general steps for setting up a web server (Apache, MySQL and PHP) on a Ubuntu server. If you are not sure on how to use unix command line see: http://www.leonardaustin.com/technical/ssh-commands

Install Apache MySQL and PHP

sudo tasksel install lamp-server
sudo /usr/sbin/apache2ctl restart

Install mod_rewrite

sudo a2enmod rewrite
sudo /usr/sbin/apache2ctl restart

You also need to find this file:

/etc/apache2/sites-available/default

and change “AllowOverride None” to “AllowOverride All” it appears a couple of times.

Install PHPMyAdmin

sudo apt-get install phpmyadmin

“In /etc/apache2/apache2.conf” Add “Include /etc/phpmyadmin/apache.conf”
The restart apache

sudo /usr/sbin/apache2ctl restart

Install XBedug – Optional for DEV only

sudo apt-get install php5-dev php-pear
sudo pecl install xdebug

# Make a note of the location of the xedebug.so then create a xdebug.ini with the below info and put it into “/etc/php5/conf.d”

; xdebug debugger
zend_extension="/usr/lib/php5/20060613/xdebug.so"
# IN php.ini file make sure html_errors = true
sudo /etc/init.d/apache2 restart

PHP Important Folder and Files

# /etc/php5
# /etc/php5/apache2/php.ini

Apache Important Folder and Files

# /etc/apache2/
# /etc/apache2/apache2.conf
# /etc/apache2/sites-available/default

Web Folder

# /var/www

Other Steps

Change php.ini errors to show all

Changing Plesk Fast CGI to Apache PHP with ZF

So recently I’ve had to change the php mode from Fast CGI to Apache Module in plesk due to the http authenticate functions in php not working. This caused my Zend Framework website to produce a 500 error, in my case it was something to do with:

Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()

The reason for the error is that the session already existed from my first visit and CGI was the owner, when I changed it to Apache module apache did not have permission to change the session data. The solution, shut down your browser (or start a privacy mode) and then try and view your website. Everything should work fine afterwards.

Twitter Updates