Fatal errors at "amportal a ma installall"

I am installing FreePBX on CentOS 6.4 using the manual at http://wiki.freepbx.org/display/HTGS/Installing+FreePBX+on+Centos+6.3#InstallingFreePBXonCentos6.3-InstallCentos6.3

Everything goes well until I get to the step at “Restart Asterisk and install FreePBX” where I give the command “amportal a ma installall” This generates the following errors:(pasted form ssh)

[[email protected] asterisk]# amportal a ma installall

Please wait…
/usr/local/sbin/amportal: line 46: [FATAL]: command not found

/var/lib/asterisk/bin/freepbx_engine: line 98: [FATAL]: command not found
**** WARNING: ERROR IN CONFIGURATION ****
astrundir in ‘/etc/asterisk’ is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p ’

mkdir: missing operand
Try `mkdir --help’ for more information.
**** ERROR: COULD NOT CREATE ****
Attempt to execute 'mkdir -p ’ failed with an exit code of 1
You must create this directory and the try again.
[[email protected] asterisk]# mcedit /usr/local/sbin/amportal

I attempted to find the cause in the php scripts but to no avail. Please advise.

It appears /var/lib/asterisk/bin/gen_amp_conf.php is not installed. Is that a correct assumption?

Thank you for your quick reply, tm1000. Just checked for /var/lib/asterisk/bin/gen_amp_conf.php and it is there. The owner and group for all the files in /var/lib/asterisk/bin are root while the group and owner of the bin directory is both asterisk. Could that be relevant?

They need to be asterisk if you follow the install guide.

run:
amportal chown

I get the same exact error when running amportal chown

Please wait…
/usr/local/sbin/amportal: line 46: [FATAL]: command not found

/var/lib/asterisk/bin/freepbx_engine: line 98: [FATAL]: command not found
**** WARNING: ERROR IN CONFIGURATION ****
astrundir in ‘/etc/asterisk’ is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p ’

mkdir: missing operand
Try `mkdir --help’ for more information.
**** ERROR: COULD NOT CREATE ****
Attempt to execute 'mkdir -p ’ failed with an exit code of 1
You must create this directory and the try again.

Please Help!!