<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>olivetalks &#187; php.ini</title>
	<atom:link href="http://www.olivetalks.com/tag/phpini/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.olivetalks.com</link>
	<description>The Olive has arrived and it has things to say…</description>
	<lastBuildDate>Tue, 16 Nov 2010 19:25:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>php.ini, symlink and moodle: I&#8217;m calling it the php.ini fiasco</title>
		<link>http://www.olivetalks.com/2008/01/21/php_ini-fiasco-with-moodle/</link>
		<comments>http://www.olivetalks.com/2008/01/21/php_ini-fiasco-with-moodle/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 22:09:22 +0000</pubDate>
		<dc:creator>LadyRostand</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[FileZilla]]></category>
		<category><![CDATA[Moodle]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[symlink]]></category>

		<guid isPermaLink="false">http://www.olivetalks.com/2008/01/21/php_ini-fiasco-with-moodle/</guid>
		<description><![CDATA[Ok, fiasco is a bit harsh. It has not been a complete failure. Just somewhat of a headache&#8230;
In my post Register_Globals Off  and PHP4, I went through the steps I took to achieve setting register_globals = OFF in my server. I was quite excited with my success and everything seemed to work just fine. [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, fiasco is a bit harsh. It has not been a complete failure. Just somewhat of a headache&#8230;</p>
<p>In my post <a href="/2008/01/17/register_globals-off-and-php4/" rel="bookmark" title="Permanent Link: Register_Globals Off  and PHP4">Register_Globals Off  and PHP4</a>, I went through the steps I took to achieve setting register_globals = OFF in my server. I was quite excited with my success and everything seemed to work just fine. Obviously, 24 hours later, the problems started to surface.</p>
<p>Now, I&#8217;m still quite happy with the whole php.ini and symlink procedure, but the same way I wrote a post on the coolness of the process, I think it will be good to share the bad experiences, in case I can prevent or at least, warn, other people in the same situation.</p>
<p>So far, the most important &#8220;bad&#8221; consequence of symlinking the php.ini file in all the folders in the server has been its interaction with how Moodle handles the uploaded assignments of students.</p>
<p>When tutors went to grade their students uploades tasks, they found that most uploaded .odt, .doc, .ods, .xls, .pdf, &#8230; documents had been replaced by php.ini. And the original exercises seemed to have disappeared overnight.</p>
<p>Moodle uses the following folder system:<br />
http://domain-name/moodle-installation/file.php/7/moddata/assignment/19/6/exercise</p>
<p>where, in this example,</p>
<ul>
<li>7 is the course number</li>
<li>19 is the assignment number</li>
<li>6 would be the student&#8217;s number</li>
</ul>
<p>And what Moodle does is once a student has uploaded an exercise, it will display the most recent file in that folder. As you can see in the following image, although the task of the student was uploaded on the 27th of September 2007, it is showing the task as php.ini (which was really created on the date of my previous post, January 17th):</p>
<p style="text-align: center"><a href="/wp-content/uploads/2008/01/moodle1c.png" title="moodle-1"><img src="/wp-content/uploads/2008/01/moodle1tiny.png" alt="moodle-1" /></a></p>
<p>To see and correct the problem, you must access the folder:<br />
/moodle-installation/uploaddata/7/moddata/assignment/19/6/</p>
<p>As you can see in the next image (the images are linked to their full sizes so you can see them better):</p>
<p align="center"> <a href="/wp-content/uploads/2008/01/moodle2.png" title="moodle-2"><img src="/wp-content/uploads/2008/01/moodle2tiny.png" alt="moodle-2" /></a></p>
<p>in the folder for this student, for this particular assignment and course, besides the original file the student uploaded in September, there is the php.ini symlink (Filezilla identifies it as a folder).</p>
<p>As the php.ini symlink, saying that register_globals should be off, is only strictly needed in the folders where php scripts are executed from, it is not really necessary to have the symlink there. So you can &#8220;just&#8221; erase it. If you are using FileZilla, you might have the program ignore your request and complain that:</p>
<p>550 Can&#8217;t change directory to php.ini: Not a directory</p>
<p>Well, I knew that&#8230; Solution I have found: create a folder, move the php.ini symlink to that folder, and erase the folder with the php.ini inside. It seems to work. For completeness I will add that the FileZilla &#8220;Not a directory&#8221; complain, showed up both in a FileZilla run in Linux and in a Virtual Machine Windows XP Installation. It did not complain, however, in a FileZilla in a laptop running Windows XP.</p>
<p>Once the php.ini symlink is erased, Moodle will display the correct uploaded task again.</p>
<p align="center"><a href="/wp-content/uploads/2008/01/moodle3c.png" title="moodle-3"><img src="/wp-content/uploads/2008/01/moodle3tiny.png" alt="moodle-3" /></a></p>
<p>This process if you have loads of students/assignments, can be a bit of a pain. Obviously, a script could be written to erase the php.ini symlink from the assignment folders, or even better, the initial symlink script could be modified to exclude the Moodle folders where you don&#8217;t want the symlink created. Without either of these scripts, though</p>
<ol>
<li>it would be better to run symlink, before any students enroll in the courses</li>
<li>if you have a server with a Moodle installation and want to install a 2nd one&#8230; I would be weary of running symlink again without some solution&#8230;</li>
</ol>
<p>No, I do not have that solution, but if anybody does, I&#8217;m all ears. And if anybody finds him or herself in a similar situation, or has other problems with Moodle, do share your experiences with me! I might be able to help or learn from you  <img src='http://www.olivetalks.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<hr align="left" width="20%" /> <a href="/category/computers/feed" title="rss feed to post"><img src="/wp-content/uploads/2008/01/feed-icon-14x14.png" alt="rss feed to post" /></a> Subscribe to the Computers posts of olivetalks, if you found this article interesting, thank you!</p>
<h3>Related post(s)</h3><ul class="related_post"><li><a href="http://www.olivetalks.com/2008/10/30/inodes-28-weeks-later/" title="Inodes 28 weeks later&#8230;">Inodes 28 weeks later&#8230; (2)</a></li><li><a href="http://www.olivetalks.com/2008/03/09/inodes-attack-part2/" title="The return of the inodes &#8211; tell me your package and I&#8217;ll tell you your inodes">The return of the inodes &#8211; tell me your package and I&#8217;ll tell you your inodes (6)</a></li><li><a href="http://www.olivetalks.com/2008/03/04/hostgator-pros-cons/" title="Hostgator: pros and cons of their web hosting offer">Hostgator: pros and cons of their web hosting offer (17)</a></li><li><a href="http://www.olivetalks.com/2008/01/17/register_globals-off-and-php4/" title="Register_Globals Off  and PHP4">Register_Globals Off  and PHP4 (1)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.olivetalks.com/2008/01/21/php_ini-fiasco-with-moodle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

