News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Unix Format php????

Started by zabbyh, October 02, 2005, 02:18:02 PM

Previous topic - Next topic

zabbyh

Hi below is what my ISP website hoster asks me to do in order to run php..

You need to upload your PHP scripts to the cgi-bin directory in your web space. The script needs to be saved in UNIX format with the extension of .php. All scripts need to have the following permissions. (You should consult your FTP client documentation for information on changing permissions). The first line of each PHP file must start with: #!/usr/bin/php

        Read Write Execute
Owner 4     2        1
Group 4                1
Other 4                 1
or, chmod 755.

A few questions then..

1. Is your SMF in the UNIX format for a php file?, if it isn't how can I make it into the UNIX format?

2. What program do you use as your ftp client in order to set the permissions..

3.  "The first line of each PHP file must start with: #!/usr/bin/php"

Do you understand what they are saying, if we take example of your install.php where would I in that file add this line "#!/usr/bin/php"

By the way do all forums require SQL??

My webserver states that it supports SSI, Perl, PHP version 4, Sendmail, Fly,  Perl based CGI scripts but they haven't stated any SQL support...

But this is the error I get whilst trying to run install.php

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


jbraum

1. Is your SMF in the UNIX format for a php file?, if it isn't how can I make it into the UNIX format?

I run my from my own server and as far as I know php is php running off of Unix (probably a Linux server is what you host is running) or Windows.  You shouldn't have to change anything in your php scripts unless the have a certain way they have configured their server.

2. What program do you use as your ftp client in order to set the permissions..

http://www.phpjunkyard.com/ftp-chmod-tutorial.php  This should help

3.  "The first line of each PHP file must start with: #!/usr/bin/php"

Not sure.  Maybe someone with a little more knowledge about why they do this can help you.


By the way do all forums require SQL??

Not necessarily.  A lot do and this particular forum does.

My webserver states that it supports SSI, Perl, PHP version 4, Sendmail, Fly,  Perl based CGI scripts but they haven't stated any SQL support...

More than likely you have SQL support.

Not all the answers but a start

zabbyh

@jbraum

Thanks for the response.. appreciated..

Anyone else able to give me some more help on questions 1 and 3...?

Dannii

Usually PHP is run as a module in apache or another web server, but in your case it seems to me that they are running it stand alone. It might be a major pain. If so, you will need to add #!/usr/bin/php to your files. However, and I'm not sure at all about this, if you're lucky you might need to add it only to index.php as the others are included into it. Or you might need to add it to every file :(

Unix format? I'm pretty sure the files will be. I think that means just UTF-8 or something. Or I could be wrong.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

zabbyh

Thanks m8's for the 2 responses I received..

I had to add the line to every single php.. Took some time. But got the installer page up and running..

Anyway after I fill some info in under mysql settings and basic settings.. I proceed and get this error

Parse error: parse error, unexpected '<' in /usr/local/DATA/WEBSITES/2005-02/zabbyh/cgi-bin/Forum/Settings.php on line 5

Since I don't know what exactly I need to enter under sql settings I have sent them an email..  But do you think this is because of that????


Oldiesmann

Sounds like your host has a really unusual PHP setup. I've only seen the #!/usr/bin/php setup one other time, and they had PHP running through some CGI wrapper. I suggest finding a better host.
Michael Eshom
Christian Metal Fans

Bonk

Quote from: Oldiesmann on October 05, 2005, 12:08:12 PM
Sounds like your host has a really unusual PHP setup. I've only seen the #!/usr/bin/php setup one other time, and they had PHP running through some CGI wrapper. I suggest finding a better host.

A statically linked compile of php running as a cgi will require that. It is a very stable and fast configuration of php.

Oldiesmann

It might be stable and fast, but it's still extremely unusual and makes running PHP scripts a pain in the rear because PHP was not designed to be run like that.
Michael Eshom
Christian Metal Fans

Advertisement: