on our new server we was getting problem with mail sending. yahoo and some other mail server was not receiving our mails to there inbox. so i imported the most popular php class (phpmailer ) in codeigniter as plugin. it’s install and use is too simple. you have to download the zip file from here, then unzip it to your plugin (system\plugins) folder. then edit phpmailer_pi.php , and edit the default configuration as needed as your mail server (default configuration will work fine with gmail smtp, you only have to edit the user name and pass) .
download:
usage:
you can now use all the functions that phpmailer supported. here is a the example that you will get in phpmailer site, but in ci format.
< ?php /* * Created on May 19, 2008 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ class Action extends Controller { function Action() { parent::Controller(); } function testMailer() { error_reporting(E_ERROR); $this->load->plugin('phpmailer'); $mail=new PHPMailer(); /*$mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port $mail->Username = "username@somedomain.com"; // GMAIL username $mail->Password = "xxxxxx"; // GMAIL password */ $mail->From = "username@somedomain.com"; $mail->FromName = "sender name"; $mail->Subject = "This is the subject"; $mail->Body = "Hi,This is the HTML BODY"; //HTML Body $mail->AltBody = "This is the body when user views in plain text format"; //Text Body //print_r($mail); $mail->WordWrap = 50; // set word wrap $mail->AddAddress("someone@somedomain.com"); $mail->AddReplyTo("username@somedomain.com","sender name"); $mail->AddAttachment("/path/to/file.zip"); // attachment $mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment $mail->IsHTML(true); // send as HTML if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent"; } } } ?> |
can’t go to softexpo ? you can see the live steaming from somewherein pavilion . to see the live steaming visit http://www.somewhereinblog.net, on the right side bar you will get the link or open mmsh://206.222.3.106:1235 with vlc player.
and this totall system is made and maintained by me, thanks to morshed bhai for his help to design the web interface. ![]()
Nowadays, lots of php developers are thinking to move their development environment to linux. And I am writing this tutorial for them. As I like Debian GNU/Linux (www.debian.org) best and ubuntu (www.ubutnulinux.org) is now doing great, in this tutorial I am using the commands for debian & ubuntu.
Ok, now starting:
First on all let’s make a list of software a PHP developer need mostly:
1.Apache
2.PHP
3.Mysql
4.PHP IDE
Ok, let’s start with Apache. Debian & ubuntu use APT to manage the packages. You can easily install apache using apt, here is the command
Debian user:
su
Ubuntu user:
sudo su
Rest of the command ar same for both debian & ubuntu.
apt-get install apache2
It will install all the apache2 & all the related packages (software)
If you need to enable mod_rewrite, follow this link
Now install the PHP
Apt-get install php5 libapache2-mod-php5
This will install the php5 and configure your apache2 server for PHP. You don’t need to do anything.
Lets test the server, if it working ok.
touch /var/www/info.php
Chown www-data:www-data info.php
Now edit this info.php with your feviourate editor and add write code to show phpinfo():
and now browse http://localhost/info.php from your browser. Now check if all your requested library are installed.
if you need any more library, you can check if it already available on your debian/ubuntu package list.
apt-cache search php5-
then you will get the list of available php5 library. Now simple use this command to install it.
apt-get install php5-gd
(example, if you want to install php5 GD library)
Remember: after installing every extra packages, you must need to restart apache server
/etc/init.d/apache2 restart
Ok, so you have now apache2 and php5 installed system. Let’s install mysql:
apt-get install mysql-server-5.0 php5-mysql
It will install all the necessary packages to run mysql-server.
Now restart your apache to take effect.
Complete!!!! Server is allmost ready.
Now i am going to derive how you will transfer your old code to this new environment. Belive me it’s too simple, so don’t worry.
First of all copy your source code to /var/www, here is the details procedure:
mkdir /windows
Here we make a folder for C drive of windows to mount.
mount /dev/hda1 /windows
then we mount the C drive to windows folder (here i use hda1 as example, if your hdd is sata then it will be sda1)
cp -r windows/Apache2/htdocs/xyz /var/www
here we copied our xyz site to /var/www (in debian and ubuntu, default apache2 root folder is /var/www)
cd /var/www
chown -R www-data:www-data xyz
Now change the ownership to www-data
Now we need to move the mysql database, there is two way:
1.use phpmyadmin
2.simple copy the database from data folder
I am deriving the 2nd way.
cp -r /windows/Mysql/data/xyz /var/lib/mysql
chown -R mysql:mysql /var/lib/mysql/xyz
You are done.
PHP Ide for linux environment:
***I know this tutorial needs more edit, please make your comments if you got anything wrong, or missed anything. I want it a cool tutorial for php developers.
Sphere: Related ContentFew minutes ago i make a unoffical repository of deb packages for debian (though it’s empty).
you have to add this line to your /etc/apt/sources.list
deb http://debian.lavluda.com binary/
if you want to release any deb file unofficaly for debian and need help to host it, send me the .deb file and don’t forget to add signature to your package.
** for testing i added the d4x on my repository, i will remove it.
please test my repository and give your feedback here.
Sphere: Related Contentগত কাল এক বন্ধুর জন্য পিএইচপিএর বাংলা বই কিনতে গিয়েছিলাম নিলক্ষেত। কিন্তু বইয়ের অবস্থা দেখে খালি হাতেই বাড়ি ফিরলাম। কি আর বলব তাদের বইয়ের কোয়ালিটি। মোট 2 টি বই পেয়েছিলাম। 1তম টায় দেখলাম পিএইচপি আর মাই এসকিউল ইনেস্টলশেন করতে করেতই অর্ধেক বই শেষ বাকিটা যা্ষ্ট ম্যানোয়ালের ট্রানসলেশন। আর দ্বিতীয় বইটিতে দেখলাম যা আলোচনা করা দরকারঁ তার সম্প্রর্কে খুব কমই লিখেছে। শুধু আজে বাজে কথায় ভর্তি।
আমি খু্বই হতাশ হলাম। চিন্তা করছি সময় করতে পারলে একবার চেষ্টা করে দেখব, একটা পিএইচপি বই লেখতে পারি কিনা যা দিয়ে যে কোন ব্যক্তি অন্তত বেসিকটা ভালভাবে বুঝে শিখতে পারবে।
Sphere: Related ContentAt last today it released from ekushey.org
Now you can download it from here
প্লাগিনটি টেস্ট করার জন্য সবাইকে ধন্যবাদ।
Sphere: Related ContentI just done the update of wordpress bangla plugin . That was developed by Hasin Hayder .
Now you can also write comments in bangla (unijoy & phonetic) without installing any extra software.
Everybody are welcome to test it by commenting here. Please write details if you get any bug.
download wordpress bangla plugin
Installation steps:
1. Download the zip file
2. extract it
3. upload the banglakb folder to http://yourdomain.com/wp-content/plugins
4. login to your admin panel and activate the banglakb plugin
5. edit your profile, and uncheck visual editor (to make post in bangla)
6. Add this code < ?php wp_banglakb_comments(); ?> in your comments.php after “comment” textarea.
Done
Hi everybody, i am lavlu from bangladesh. Basically i am a linux fan. Though right now working as Web Application Developer in somewherein….
Yesterday i took this domain for my blog. Please don’t forget to come back. You will get information about me, my works, linux & many more things.
The design is not fixed yet, if you have any opinion, please write in comment.
Sphere: Related ContentAt last I got my phpED (license copy). Thanks goes to Hasin Hayder.
Hope it will help me to make batter experience with PHP.
Soon i will write review on phpED 5.0
Sphere: Related ContentHere is the simple step to install ttf font on Debian or Ubuntu or debian based linux.
First of all make a font directory to store the fonts. Better use “/usr/share/fonts/ttf”
So make the font directory:
Debian (login as root or use su):
mkdir /usr/share/fonts/ttf
Ubuntu:
sudo mkdir /usr/share/fonts/ttf
If u want to install the ttf font from windows, simple copy them from c:\windows\Fonts
Debian:
mkdir windows
mount /dev/hda1 windows
cd windows/Fonts
cp *.ttf /usr/share/fonts/ttf
Ubuntu:
mkdir windows
sudo mount /dev/hda1 windows
cd windows/Fonts
sudo cp *.ttf /usr/share/fonts/ttf
Now u need to generate the fonts.scale fonts.dir, so u have to install the ttmkfdir and mkfontdir.
Debian:
apt-get install ttmkfdir
cd /usr/share/fonts/ttf
ttmkfdir > fonts.scale
mkfontdir
Ubuntu:
sudo apt-get install ttmkfdir
cd /usr/share/fonts/ttf
sudo ttmkfdir > fonts.scale
sudo mkfontdir
Most of the works finished. U only need to add the font path to xwindows.
Debian:
nano /etc/X11/xorg.conf
Ubuntu:
sudo nano /etc/X11/xorg.conf
then add the fontpath to xorg.conf
FontPath “/usr/share/fonts/ttf”
Now restart ur display manager or total system.
Debian:
/etc/init.d/gdm restart
Ubuntu:
sudo /etc/init.d/gdm restart
If nothing goes wrong, ur done. Congrutulation!!!!!!!!
Sphere: Related Content