Sunday, March 21, 2010

Activating the User's public_html Directory with userdirectory (Using Apache2 )

Create a directory (folder) called "public_html" in your home directory, with your file browser or the command below. Do NOT use the sudo command.
me@myhost$ mkdir public_html

I have found that on a simple development machine, it is easier to have your work all within your own home directory and not have to worry about permissions and folders owned by the root user. What it gets you is the ability to access your websites in your home directory by a URL in the form http://localhost/~USER_NAME. We can improve upon this with fake domains, but first things first.
There are only two commands you need to enter to activate the User Directory feature, and then one command to reload the configuration files. The last command includes an absolute path, so it doesn't matter where you execute it from. The first two "ln" commands assume you are in the directory /etc/apache2/mods-enabled. What you need to do is create two symbolic links (soft links, symlinks) in the stated directory pointing to the corresponding module in /etc/apache2/mods-available. So, if "$" is your prompt,
me@myhost$ cd /etc/apache2/mods-enabled
me@myhost$ sudo ln -s ../mods-available/userdir.conf userdir.conf
me@myhost$ sudo ln -s ../mods-available/userdir.load userdir.load
me@myhost$ sudo /etc/init.d/apache2 restart

On your home system, restarting apache will give you a warning "apache2:

Wednesday, March 3, 2010

.odt on fly

What is odtPHP ? 
OdtPHP is an oriented object libary for PHP 5+. It allows you to generate automatically OpenOffice text documents from templates. You can use it directly within your PHP scripts (without OpenOffice).
OdtPHP is very easy to use : with a minimum of code, you will be able to generate simple documents by replacing tags from template and by inserting some images. You can also take advantage from advanced features in order to create complex OpenOffice files by repeating parts of the document or lines of array.


OdtPHP allows you to replace tags from your OpenOffice template by text content or pictures. The library also handles loops that can be imbricated as you want. Moreover, odtPHP allows you to simply repeat lines of OpenOffice tables. Eventually, you can export the final result in a file on your server or directly to the client browser.


Download odtPHP 

OdtPHP is released under the terms of the GNU Public License. To get more informations about the GPL license, For download   Click Here

Working Experience  :-

Its is very easy to run  ,by using the library .

But  there is one Problem that is

> By default there is no permission to access some labrary files 

Run by http://localhost/odtphp/tests/tutoriel1.php link on 

There error is  on the  bowers when we convert file into odt format :- 

> Warning: mkdir() [function.mkdir]: Permission denied in /var/www/odtphp/library/zip/PclZipProxy.php on line 50

> Warning: mkdir() [function.mkdir]: Permission denied in /var/www/odtphp/library/zip/PclZipProxy.php on line 50

> Warning: file_put_contents(./tmp/content.xml) [function.file-put-contents]: failed to open stream: No such file or directory in /var/www/odtphp/library/zip/PclZipProxy.php on line 94

> Fatal error: Uncaught exception 'OdfException' with message 'Error during file export' in /var/www/odtphp/library/odf.php:250 Stack trace: #0 /var/www/odtphp/library/odf.php(266): Odf->_save() #1 /var/www/odtphp/tests/tutoriel1.php(31): Odf->exportAsAttachedFile() #2 {main} thrown in /var/www/odtphp/library/odf.php on line 250

How to remove this errors :-  
> we can remove this errors by change the file permission by usibg this commonds on terminal of ubuntu   

#chmod -R 777 /var/www/odtphp/

than its working .....................