php.ini problem

php.ini problem

Posted by: windtown
Posted on: 2009-09-12 21:01:00

#!/bin/sh
CGIFILE="$HOME/abc.com/cgi-bin/php.cgi"
INIFILE="$HOME/abc.com/cgi-bin/php.ini"
rsync -a /dh/cgi-system/php5.cgi "$CGIFILE"
cp /etc/php5/cgi/php.ini "$INIFILE"

perl -p -i -e '
s/.*post_max_size.*/post_max_size = 100M/;
s/.*upload_max_filesize.*/upload_max_filesize = 100M/;
' "$INIFILE"

it's saved as one abc.sh.
i just tried to make my custom php5 into my website. but while i execute abc.sh, come out with one problem, -bash: ./abc.sh: /bin/sh^M: bad interpreter: No such file or directory.

anyone can help me with this. thank you.


Re: php.ini problem

Posted by: rlparker
Posted on: 2009-09-12 21:13:00

What about that ^M ? Are you editing that shell file with an editor that doesn't support unix style line endings?

--rlparker
--DreamHost Tech Support

Re: php.ini problem

Posted by: Atropos7
Posted on: 2009-09-12 21:14:00

In reply to:

it's saved as one abc.sh.
i just tried to make my custom php5 into my website. but while i execute abc.sh, come out with one problem, -bash: ./abc.sh: /bin/sh^M: bad interpreter: No such file or directory.


What did you use to edit abc.sh? The ^M leads me to believe you uploaded it from a Windows system with binary FTP mode. If for some reason you have to upload via FTP as binary you will want to run dos2unix on the text file.

Then also try changing
#!/bin/sh
to
#!/usr/bash



Customer since 2000 cool openvein.org

Re: php.ini problem

Posted by: windtown
Posted on: 2009-09-12 21:19:00

i uses windows vista to edit the file, but i not meet any problem last week. now i need the cgi to use for another website. and it met this problem.

Re: php.ini problem

Posted by: sXi
Posted on: 2009-09-12 21:20:00

$ dos2unix abc.sh
$ sh abc.sh




How To Install PHP.INI / ionCube on DreamHost

Re: php.ini problem

Posted by: rlparker
Posted on: 2009-09-12 21:26:00

What sxi and Atropos7 said! :-)

--rlparker
--DreamHost Tech Support

Re: php.ini problem

Posted by: windtown
Posted on: 2009-09-12 21:26:00

done. thank you :D

Tags: cgi systemmax sizefilesizeinterpretercgi binabc