Running PHP open source applications: NOBODY needs authority

User NOBODY needs to be granted authority in the IFS folder containing an open source PHP application on the AS/400 in order to run the script. Learn how to change this authority on the IBM i, and successfully run an open source PHP application on your system.

After installing Zend Core on my IBM i, I could hardly wait to download my first open source PHP application. I searched for an open source PHP CRM application and found numerous examples on Sourceforge. Once I found the PHP application that met my needs, I downloaded it to my laptop and uploaded it to the /www/zendcore/htdocs/ directory on my System i IFS. This directory is where I keep all of my scripts, as it allows me have a central...

location for all of my PHP applications.

I began to follow the installation instructions provided only to have the PHP script halt, and an error message appeared in the browser. The message said that I did not have the proper authority to the new application folder that I uploaded.

I then realized I had forgotten an important step after I had loaded the application to the IBM i IFS, and that was to grant user NOBODY authority to the folder uploaded to the /www/zendcore/htdocs directory. This problem is easy to correct. Open up an AS/400 green screen and do the following:

  1. Change the directory to the /www/zendcore/htdocs. To do this, key in the following command:

    CHGCURDIR '/www/zendcore/htdocs'

    and press 'ENTER.' This will put you at the Web documents root for Zend Core.

  2. For a quick verification that the directory is changed you can run the WRKLNK command from a green screen command line. You should then see the folders and files located in the /www/zendcore/htdocs directory.
  3. On the same green screen key the CHGAUT command as follows or prompt the command by pressing F4. The CHGAUT command should be keyed as follows:

    CHGAUT OBJ('OpenSourceFolder/') USER(NOBODY) DTAAUT(*RWX)

    press 'ENTER' to continue, when the command is completed you will see that it has changed the authority for a number of objects within the new open source folder that you have uploaded. Should you desire to see if the authority is correct you can WRKLNK to the /www/zendcore/htdocs directory and locate your open source folder and key a '9' in the option field and press 'ENTER' and you should now see user NOBODY has authority.

  4. Open your preferred browser and enter the URL as outlined in the installation instructions for setting up the new open source application. It may appear something like the following:

    http://server_name:port#/OpenSourceFolder/install.php

Voila! You should now see the installation screen to complete the application setup process. The user NOBODY is used by Zend Core to allow access to the folder and folders that reside in the new open source application directory. The benefit of running CHGAUT on the open source folder is to eliminate the "Unauthorized Access" error message received when you try to install the open source application, thus giving you a clean installation.

Editor's note: Previews of PDFs with sample code are available for

Let us know what you think about this tip, send us a note and let us know if you want more tips on this topic, and if there are any specific areas you would like to see covered.

ABOUT THE AUTHOR: Larry Nies is President and co-founder of NSC, Inc.. Nies has been involved with IBM as a Business Partner since 1984, working on S/38, S36, S/3, AS/400, iSeries, i5 System i. He is a proficient RPG programmer and wrote his first Web application in 1997 using Net.Data on an AS/400 and have since used Java, HTML, Javascript, Ajax, PHP etc. Nies was first Exposed to PHP on the iSeries in 2006 following installation of Zend Core on an iSeries, and has been writing PHP applications ever since. He has consulted and programmed for a variety of industries, including distribution, logistics, manufacturing, and local governments.

This was first published in May 2009

Dig deeper on iSeries application development tools

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close