<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://bliki.rimuhosting.com/rdf'>
    <s:Snip rdf:about='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache/php'
         s:cUser='kron'
         s:oUser=''
         s:mUser='paolo'>
        <s:name>knowledgebase/linux/webserver/apache/php</s:name>
        <s:content>1 Compiling PHP mcrypt extension&#xD;&#xA;&#xD;&#xA;Note: These instructions are for RHEL4-based distributions.&#xD;&#xA;&#xD;&#xA;You&apos;ll need the PHP &apos;devel&apos; package, g++ and libtool to build mcrypt&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;apt-get install php-devel autoconf cpp gcc-c++ libtool&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Grab it and install it&#xD;&#xA;{code:none}&#xD;&#xA;function installmcrypt() {&#xD;&#xA;wget &quot;http://easynews.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.7.tar.gz&quot;&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;tar xzf libmcrypt-2.5.7.tar.gz&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;cd libmcrypt-2.5.7&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;./configure --disable-posix-threads&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;replace &quot;CFLAGS = -g -O2&quot; &quot;CFLAGS = -g -O2 --disable-posix-threads&quot; -- Makefile&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;make &amp;&amp; make install&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;}&#xD;&#xA;installmcrypt&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Now grab the PHP source and build the extension. You&apos;ll need the source tarball matching your distributions PHP version (4.3.7 for RHEL4).&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;function phpizemcrypt() {&#xD;&#xA;&#xD;&#xA;wget &quot;http://www.php.net/get/php-4.3.9.tar.gz/from/www.php.net/mirror&quot;&#xD;&#xA;&#xD;&#xA;if [ $? -ne 0 ]; then &#xD;&#xA;&#xD;&#xA;wget &quot;http://museum.php.net/php4/php-4.3.9.tar.gz&quot;&#xD;&#xA;&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;&#xD;&#xA;fi&#xD;&#xA;&#xD;&#xA;tar xvzf php-4.3.9.tar.gz&#xD;&#xA;&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;&#xD;&#xA;cd php-4.3.9/ext/mcrypt&#xD;&#xA;&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;&#xD;&#xA;phpize&#xD;&#xA;&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;&#xD;&#xA;./configure&#xD;&#xA;&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;&#xD;&#xA;make &amp;&amp; make install &#xD;&#xA;&#xD;&#xA;if [ $? -ne 0 ]; then return 1; fi&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#xD;&#xA;phpizemcrypt&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;phpize failing? Try an older version of automake and then re-run phpize, configure, make, make install.&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;{&#xD;&#xA;apt-get install automake-1.7&#xD;&#xA;mv /usr/bin/aclocal /usr/bin/aclocal.old&#xD;&#xA;ln -s /usr/bin/aclocal-1.7 /usr/bin/aclocal&#xD;&#xA;}&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Finally, setup the extension in your php.ini or /etc/php.d if RHEL4-based, and restart Apache:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;{&#xD;&#xA;echo &quot;extension=mcrypt.so&quot; &gt; /etc/php.d/mcrypt.ini&#xD;&#xA;/etc/init.d/httpd restart&#xD;&#xA;}&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Check to see that mcrypt shows up in a test phpinfo() page.&#xD;&#xA;&#xD;&#xA;Other extensions can be built in a similar way (i.e. make sure you have the dependancies, grab the PHP tarball, and use phpize, configure, make, make install).&#xD;&#xA;&#xD;&#xA;1 Testing php send mail capabilities&#xD;&#xA;&#xD;&#xA;From: http://www.webcheatsheet.com/php/send_email_text_html_attachment.php&#xD;&#xA;&#xD;&#xA;Edit and save the following file in a externally accessible directory from your web server (usually /var/www/html or /var/www):&#xD;&#xA;&#xD;&#xA;http://bliki.rimuhosting.com/space/knowledgebase/linux/webserver/apache/php/mailtest.php&#xD;&#xA;&#xD;&#xA;Then if you saved it as test.php, go to http://207.210.242.17/test.php and see if you got the e-mail. If you didn&apos;t check the mail logs (/var/log/maillog or /var/log/mail.log) to see what happened.&#xD;&#xA;&#xD;&#xA;1 Enabling an upload directory for PHP scripts in Debian &#xD;&#xA;&#xD;&#xA;The default php.ini file lacks the configuration directive for upload_tmp_dir, which is needed for file uploads. That is default on Debian for security purposes.&#xD;&#xA;&#xD;&#xA;In order to use an upload directory, set the upload_tmp_dir parameter in php.ini to a directory that can be read and modified by the HTTP server user. </s:content>
        <s:mTime>2008-02-14 12:00:10.0</s:mTime>
        <s:cTime>2005-08-26 00:18:46.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache/php/'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux'/>
                <rdf:li rdf:resource='#knowledgebase'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/ruby on rails'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/distros/ubuntu'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#KDE4 and the Plasma desktop'/>
                <rdf:li rdf:resource='#kron'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/phpmyadmin'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/distros/RHEL 4'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/ajax autocomplete'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/filtered webmin'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#virtualmin notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/Build php 5.1.6 rpm on RHEL4'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/vps setup on dedicated servers'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/setting up mysql replication'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/rpm based mysql5 install'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache/installing and using mod_fastcgi'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/qmail notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/monit service monitoring'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/argh my server was exploited'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfixadmin on debian sarge'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache/mod_rewrite'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/java/tomcat on plesk'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/distros/debian'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/rimuhosting ssh access'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments>
            <rdf:Bag>
                <rdf:li>
                    <s:Attachment rdf:about='http://bliki.rimuhosting.com/space/knowledgebase/linux/webserver/apache/php/mailtest.php'
                         s:fileName='mailtest.php'
                         s:contentType='text/plain'
                         s:size='622'>
                        <s:date>Wed May 30 16:09:35 EDT 2007</s:date>
                    </s:Attachment>
                </rdf:li>
            </rdf:Bag>
        </s:attachments>
    </s:Snip>
</rdf:RDF>
