Skip to main content

Posts

Showing posts from August, 2008

Install PHP Pear Mail

Step # 1: Download files Use wget command to download all files: # cd /tmp # wget http://download.pear.php.net/package/Mail-1.1.14.tgz # wget http://download.pear.php.net/package/Net_SMTP-1.2.10.tgz # http://download.pear.php.net/package/Net_Socket-1.0.8.tgz Untar all files: # tar -zxvf Mail-1.1.14.tgz # tar -zxvf Net_SMTP-1.2.10.tgz # tar -zxvf Net_Socket-1.0.8.tgz Step # 2: Install files Simply copy file to your webroot such as /www/usr/share/pear or standard location such as /usr/share/pear: # cd /usr/share/pear # mkdir Net # cd Net # cp /tmp/Net_SMTP-1.2.10/SMTP.php . # cp /tmp/Net_Socket-1.0.8/Socket.php . # cd .. # cp -avr /tmp/Mail-1.1.14/Mail/ . # cp -avr /tmp/Mail-1.1.14/Mail.php . Step # 3: Test SMTP email Now you have required files, all you have to do is send email using authenticated smtp server. download pear from website # cp -avr /tmp/Pear-1.7.2/Pear/ . # cp -avr /tmp/Pear-1.7.2/Pear.php .

Set up Mail Server on Ubuntu

PHP send email setup http://ph.ubuntuforums.com/showthread.php?t=887081 To install postfix sudo apt-get install postfix Intall mailx package for use as command mail utility program. Mail command is installed with this package. sudo apt-get install mailx Add a user before you start this. sudo useradd -m -s /bin/bash fmaster sudo passwd fmaster Test your default installation using the following code segment. telnet localhost 25 Postfix will prompt like following in the terminal so that you can use to type SMTP commands. Trying 127.0.0.1... Connected to mail.fossedu.org. Escape character is '^]'. 220 localhost.localdomain ESMTP Postfix (Ubuntu) Type the following code segment in Postfix's prompt. ehlo localhost mail from: root@anywher.com rcpt to: support@localhost data Subject: My first mail on Postfix Hi, Are you there? Regards, Admin .(Type the .[dot] in a new Line and press Enter ) quit Check the mailbox of support su - support (change user to support after login to th

Install Pear

MAC 1. go to http://pear.php.net/go-pear and save it as go-pear.php 2. run php go-pear.php on the server 3. follow the step Ubuntu sudo apt-get install php-pear #install mail pear install mail

Install LAMP of Ubuntu

This will install Apache2, PHP5, MySql5, and PHPMyAdmin. Firstly, type the following command at the console: apt-get update This will retrieve new lists of packages. Next type: sudo apt-get install apache2 php5 mysql-server-5.0 phpmyadmin This will install all the necessary applications. You may be prompted to decide on a MySQL root password (set one if you want), and to configure PHPMyAdmin (select apache2 as the server type). After this is complete, we need to perform some minor configuration to get PHPMyAdmin working. Type: sudo gedit /etc/apache2/apache2.conf Scroll right to the bottom of the file that opens, and add: # Enable PHPMyAdmin Include /etc/phpmyadmin/apache.conf Now save, exit, and type: sudo /etc/init.d/apache2 restart Everything should now be configured - go to http://127.0.0.1 for webpages, and http://127.0.0.1/phpmyadmin for database administration. The webroot is located in /var/www/ by default. This is not particularly useful, as we do not ha

Sendmail at Ubuntu

Cannot use mail function in PHP. Problem: Cannot send mail via the mail function in PHP script. Cause: sendmail was not installed by default. Solution: 1. install sendmail : sudo apt-get install sendmail 2. test : sudo apt-get install nmap nmap -sT localhost if sendmail works, you will see ************************************************* tarting Nmap 4.53 ( http://insecure.org ) at 2008-08-09 06:46 UTC Interesting ports on tcm (127.0.0.1): Not shown: 1708 closed ports PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 25/tcp open smtp 80/tcp open http 587/tcp open submission 3306/tcp open mysql *************************************************

PHP Problem

1. Problem: Get session error on the top of the page Solution: Move session start to the top of the page instead of putting between body or head 2. Problem: header (location:/) does not work Solution: Should remove html tag before using header function in PHP