.htaccess & cgi-php

nemof

Joined: 2002-10-13
Posts: 2
Posted: Sun, 2002-10-13 19:57

hey all. i am setting up gallery using the cgi version of php on freebsd. i have uploaded the binary to cgi-bin and chmod'd it to 755. I have uploaded all the gallery code. i have written the .htaccess file:

AddType application/cgi-php php
Action application/cgi-php /cgi-bin/php.cgi

and uploaded that to the 'php-cgi' directory.

the problem is that php-cgi is not in the base directory. I can't write to the base directory of my webserver, as that is how my provider has it setup.
basically i have a structure like this:

cgi-bin/ (where php.cgi has gone)
httpdocs/ (where all my files go, such as the php-cgi directory and the gallery directory under that)

i imagine that i need to edit the .htaccess file to include the correct path, but i'm not sure how to do so. I would appreciate some help!
also, should I upload php.cgi in ascii or binary mode?

thanks for your help!

-nemof :lol: :lol:

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Sun, 2002-10-13 20:04

This is a gallery forum, not a PHP setup forum. Please read the <!-- BBCode Start --><A HREF="http://php.net/manual/" TARGET="_blank">PHP Documentation</A><!-- BBCode End -->.

 
nemof

Joined: 2002-10-13
Posts: 2
Posted: Sun, 2002-10-13 20:19

i've got a problem setting up gallery, not with php. it's todo with .htaccess. this is the 'Installation and Configuration Help' forum, i'm asking for help. i've never dealt with .htaccess files before and as this is todo with gallery this is the right place to ask.

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Sun, 2002-10-13 21:06

If you are trying to setup PHP, the right place to look is in the PHP Documentation, under Installation. I'm not trying to be mean or harsh, but by the looks of your posts, you are trying to setup PHP (and eventually gallery). Please read the Installation directions in the PHP Manual and once you get it setup, come back here :smile:

 
m_2k

Joined: 2002-10-17
Posts: 3
Posted: Thu, 2002-10-17 16:53

I have similar problem to nemof. joyoflinux, I think you were pretty harsh with nemof. You have to understand that not all of us are experts like you are.

If only the instructions in the faq were clear and used correct, descriptive terminology.

 
horo

Joined: 2002-10-19
Posts: 4
Posted: Sat, 2002-10-19 03:03

I have a similar question. Among other problems, there is at least one word dropped from a crucial sentence in section 2.3 of the FAQ. Like the other questioners here, I have a third-party provider that runs PHP as a CGI. Other than a php.ini file, I am NOT trying to set up PHP -- I do not have any control over the setup of PHP (short of the php.ini file).

We are trying to set up GALLERY. We are following directions in the GALLERY FAQ. I am able to go to the GALLERY configuration page, but when I try to start the GALLERY setup wizard, I get a server 500 message.

I have gone as far as I can with my hosting provider - I came here to get some help from the much-touted GALLERY COMMUNITY, and I see two people with legitimate, similar questions to mine getting rudely shut down.

Before I nuke the product completely, I'd like to take another shot at some courteous help. Is there anyone willing to read the configuration issues we have, and provide some insight?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2002-10-20 00:02
Quote:
I have a similar question. Among other problems, there is at least one word dropped from a crucial sentence in section 2.3 of the FAQ. Like the other questioners here, I have a third-party provider that runs PHP as a CGI. Other than a php.ini file, I am NOT trying to set up PHP -- I do not have any control over the setup of PHP (short of the php.ini file).

What word was dropped from which sentence? I can fix the FAQ if you tell me what needs to be amended.

If your provider gives you PHP as CGI then your battle is mostly won. The main thing you
need to do at this point is to make sure that you set up your type and action map in your webserver config file to make sure that it maps files that end in .php to point to your CGI version of PHP

Quote:
We are trying to set up GALLERY. We are following directions in the GALLERY FAQ. I am able to go to the GALLERY configuration page, but when I try to start the GALLERY setup wizard, I get a server 500 message.

Ok. I assume that you've read FAQ C and have checked your Apache error log. What happened when you tried removing setup/.htaccess? And what showed up in the error log?

Quote:
I have gone as far as I can with my hosting provider - I came here to get some help from the much-touted GALLERY COMMUNITY, and I see two people with legitimate, similar questions to mine getting rudely shut down.

Before I nuke the product completely, I'd like to take another shot at some courteous help. Is there anyone willing to read the configuration issues we have, and provide some insight?

The problem is this: There are many, many, many different ways that an ISP can configure PHP as CGI. We (the Gallery developers) are focussed on writing a product
and that product expects to run on a working version of PHP that is not in safe mode. We do state this pretty clearly in the <!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=phpWiki&amp;file=index&amp;pagename=Gallery%20Requirements" TARGET="_blank">Requirements</A><!-- BBCode End --> page.

Now, it sounds to me like your PHP is not properly configured such that it interprets .php
files with safe mode off, because if it was properly configured, then we wouldn't be
having this conversation. Hence, your problem is really one of configuring PHP properly
and while we do try to help out with this particular problem you have to realize that
this is beyond the scope of Gallery support.

So, I agree that joyoflinux was pretty abrupt with his answer. But what he said was the truth: if you're having problems configuring PHP to run as a CGI binary then you should probably refer to the PHP community in general since they are going to be far more
qualified to help you than we are. I provided the best answer that I can in FAQ B.3 -- as
I mentioned above, if you have amendments or further questions about that I can
try to answer them and update the FAQ.

 
horo

Joined: 2002-10-19
Posts: 4
Posted: Sun, 2002-10-20 05:15

I started another thread about my specific problem, and detailed the confusion with the FAQ there:

http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=1241&amp;1

I also posted a follow-up that my proficer was able to fix it. They modified the .htaccess in my gallery/setup directory -- in almost an identical way as was described for the cgi-bin .htaccess file in the FAQ.

I'm still al little foggy on the details of how .htaccess fits into the world, and why this fix worked while the FAQ suggestions didn't -- but as noted, this is a question for the Unix/PHP community at large -- not the Gallery boards.

The more reasoned reply is much appreciated -- throwing someone into the deep end of the PHP documentation isn't the kind of solution that will make enthusiastic supporters of the product.

..Howard