<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.1" -->
<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/"
	>

<channel>
	<title>Mo Jebus &#187; PHP</title>
	<link>http://moronicbajebus.com</link>
	<description>Banana Ice Cream!</description>
	<pubDate>Wed, 06 Aug 2008 14:30:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>
	<language>en</language>
			<item>
		<title>PHP Upload File Permissions On AFS</title>
		<link>http://moronicbajebus.com/2006/07/14/php-upload-file-permissions-on-afs/</link>
		<comments>http://moronicbajebus.com/2006/07/14/php-upload-file-permissions-on-afs/#comments</comments>
		<pubDate>Fri, 14 Jul 2006 17:35:49 +0000</pubDate>
		<dc:creator>Seamus</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Frontpage]]></category>

		<guid isPermaLink="false">http://moronicbajebus.com/?p=73</guid>
		<description><![CDATA[A common problem (as a quick search shows) when creating a file upload script in PHP is the permissions on the destination directory. The PHP engine must have permissions to write a file to the destination directory. For Linux and Unix file system, the standard way is to use CHMOD; but, the method is different [...]]]></description>
			<content:encoded><![CDATA[<p>A common problem (as a quick search shows) when creating a file upload script in PHP is the permissions on the destination directory. The PHP engine must have permissions to write a file to the destination directory. For Linux and Unix file system, the standard way is to use CHMOD; but, the method is different if the file system is <a href="http://en.wikipedia.org/wiki/Andrew_file_system">AFS</a> which I have seen the most use by colleges such as UMBC.  Here’s how I went about fixing it:</p>
<p>The error message:<br />
<code>Warning: move_upload_file(): Unable to move "(src)" to "(destination)" in (php file path) on line NNN</code></p>
<p>The fix:<br />
I had to give permissions to add files (i) to the destination directory to the user that PHP is running as.  I found the user for PHP by looking at user’s on the directory PHP is located in: “<code><a href="http://www.openafs.org/pages/doc/AdminReference/auarf148.htm#HDRFS_LISTACL">fs listacl</a></code>”. I found PHP by running <code>php_info()</code> and seeing where many of the file paths share in location. Most of the file paths are the same up till the last directory so use the common part of the different paths. I found PHP to be located at <code>(common path)/bin</code>.</p>
<p><code>> cd (common path)/bin<br />
> fs <a href="http://www.openafs.org/pages/doc/AdminReference/auarf148.htm#HDRFS_LISTACL">listacl</a><br />
Access list for . is<br />
Normal rights:<br />
  (the-php-user) rl<br />
  system:administrators rlidwka</code></p>
<p>Since I knew the user wasn’t system:administrators it had to be the other user. </p>
<p>Going back to the parent directory of the destination directory for my file upload, I set permission for the-php-user:<br />
<code>> cd ~/www/<br />
> fs <a href="http://www.openafs.org/pages/doc/AdminReference/auarf157.htm#HDRFS_SETACL">sa</a> (desination directory) (the-php-user) rlidwka</code></p>
<p>This may not be complete but I hope it helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://moronicbajebus.com/2006/07/14/php-upload-file-permissions-on-afs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>First Run With Pear</title>
		<link>http://moronicbajebus.com/2006/01/19/first-run-with-pear/</link>
		<comments>http://moronicbajebus.com/2006/01/19/first-run-with-pear/#comments</comments>
		<pubDate>Thu, 19 Jan 2006 05:56:29 +0000</pubDate>
		<dc:creator>Seamus</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Frontpage]]></category>

		<guid isPermaLink="false">http://moronicbajebus.com/wordpress/?p=42</guid>
		<description><![CDATA[At my job, I have recently been between projects. I have recently discovered PEAR which the concept of a library of PHP classes is something that I have wanted. I wanted to install these classes on the schools server. Since I cannot add packages to the main repository I took to following the directions on [...]]]></description>
			<content:encoded><![CDATA[<p>At my job, I have recently been between projects. I have recently discovered <a href="http://pear.php.net">PEAR</a> which the concept of a library of PHP classes is something that I have wanted. I wanted to install these classes on the schools server. Since I cannot add packages to the main repository I took to following the <a href="http://pear.php.net/manual/en/installation.shared.php">directions on creating an individuals repository</a> using the directions for doing exactly that on a shared host.</p>
<p>The directions worked as described on my personal web server; but the directions did not work on the UMBCs server. Here are a list of things I did to get it to work:</p>
<ol>
<li>The pear command did not work from command line. To find where it was located I did some searching. I started from where I knew PHP was located by using provided by <code>php_info()</code> and I found the pear program  located in the bin directory. To make simpler for myself, I added the location of pear to my path environment variable.</li>
<li>To figure out what version of PEAR you are using, run the command <code>pear V</code>.</li>
<li>The pear directory was not being created when I would run the command. The pear directory should have been in my home directory because it was specified there with the shortcut <code>~/</code> but since it was not I used the full path to my home directory which then created the pear directory where it I wanted it.</li>
<li>I first located the PEAR repository directory in my home directory and I got the following errors in the PHP files: <code>Fatal error: main(): Failed opening required '&lt;package&gt;'</code>.  I discovered PHP did not have group permissions to access my home directory so I placed the repository in my web directory as a quick and simple fix.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://moronicbajebus.com/2006/01/19/first-run-with-pear/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
