Wednesday, June 29, 2011

APACHE SERVER AND PHP, POST INSTALLATION PROBLEMS

PHP POST INSTALLATION PROBLEMS

1. Cannot parse PHP files.
I’m still not able to parse PHP files when I attempt to open them in a browser, I get the option to download them instead. I’ve tried several steps and nothing works.

Solution:
Perform the following tasks
sudo apt-get install libapache2-mod-php5
sudo a2enmod php5

Then re-start Apache:
sudo /etc/init.d/apache2 restart

2. No write permission.
I get the “it worked message”. So everything install semi correctly at least. However, when I try to copy or save files in the /var/www/ folder, I can't. Any ideas?

Solution:
Terminal:
sudo chown USERNAME /var/www/

3. Could not connect to MYSQL server. Here is the PHP code

$host = 'localhost';
$user = 'root';
$pass = 'mypassword';
$database = 'mysql';

mysql_connect($host,$user,$pass);
@mysql_select_db($database) or die( "Unable to select database");

Solution:
Change the value of $host variable from 'localhost' to '127.0.0.1'

4. When I am trying to access a php files below the root folder through my localhost and Apache is giving me a 403 error.

Forbidden
You don't have permission to access /distribution/sample-html-simple.php on this server.

Apache/2.2.16 (Ubuntu) Server at localhost Port 80

Solution:
Make sure folder is accessible to www-data, on the terminal type the command:
sudo chown -R www-data "/var/www/distribution"

Tuesday, June 14, 2011

UBUNTU DESKTOP 10.10 WORKS GREAT WITH EPSON STYLUS TX121 (Scanner, Printer, Copier)

Epson Stylus TX121 Multifunction printer is a 3 in 1 device that is capable of scanning images, printing documents and photocopying. I bought this in the market last January of 2011. It's plug and play device prints text and graphics very well in Ubuntu 10.10 desktop. Although the printed output of this printer looks great, it is not fully supported because the scanning feature does not function. In Ubuntu 10.10 there's no driver that matches this model. The OS recommended other driver when you install the device. The recommended package works well for printing only but for scanning does not because the scanning software cannot recognize the source device. After goggling the internet to find out if there's already a driver ready for download. Yes there is and you can download from AVASYS website. Look for the following files from this website and download them.
  1. iscan-data_1.8.1-1_all.deb
  2. iscan_2.26.3-1.ltdl7_i386.deb
  3. epson-inkjet-printer-n10-nx127_1.0.0-1lsb3.2_i386.deb

Follow the order of installation:

Dependencies first
iscan-data_1.8.1-1_all.deb
iscan_2.26.3-1.ltdl7_i386.deb

Core package next
epson-inkjet-printer-n10-nx127_1.0.0-1lsb3.2_i386.deb

This device driver also supports other printer models such as Epson ME 320/330, Epson Stylus NX125/NX127/SX125/TX120/TX123/TX125/TX129

When done TX121 is ready to rock and roll.