WordPress.org

Ready to get started?Download WordPress

Forums

Running PHP as a CGI (7 posts)

  1. thedara
    Member
    Posted 8 years ago #

    Heya,
    I'm trying to install WordPress on a debian Woody install, with PHP 4.3.10-13 running as a CGI,and I have "mysql Ver 12.22 Distrib 4.0.24, for pc-linux-gnu (i386)"

    I followed these instructions first ( http://www.redbrick.dcu.ie/~wiki/mw/Installing_Wordpress_on_Redbrick )
    to make sure that WordPress would work straight away, (ie. Edited the mentioned files before running wp-admin/install.php ) also edited the wp-config.php before doing anything else, basically followed the insructions (albeit from different sources)

    and my apache (apache two btw) error log is saying "Premature end of script headers: install.php"

    the usual source of this problem is putting a space between the "#!/usr/local/bin/php" and the <?php tag by mistake but in this case this mistake has not been made, i'm here all night so please if you have a question that may help you help me please ask :)

    ps. I really wish there was a preview post button here :)

  2. thedara
    Member
    Posted 8 years ago #

    anychance anyone could have a look at this?

  3. mcgoy
    Member
    Posted 8 years ago #

    I'm have the same problem:
    http://mcgoy.plumbearcat.com/bin/wp-admin/install.php
    Here's my apache tags:
    Apache/2.0.45 (Unix) PHP/5.0.5 FrontPage/5.0.2.2634 Server at mcgoy.plumbearcat.com Port 80
    MySQL: 4.1.12 installed from tar ball.
    index.php does the same.

  4. vkaryl
    Member
    Posted 8 years ago #

    I've got a couple installs running with apache-as-cgi, no problems.... these are on webhosts not self-hosted.

  5. estjohn
    Member
    Posted 8 years ago #

    Are you sure you got the paths right in the config?

  6. mcgoy
    Member
    Posted 8 years ago #

    I'm new to PHP, just an old, weak perl guy. Anyway, I threw all this stuff up into my cgi directory where I run perl scripts and it doesn't run. I hacked a few PHP scripts in that directory and they did't work either. The light came on! Nothing to do with wordpress, no PHP runs from that directory! It started to sink in that PHP is more like ASP than CGI, so I threw it over into my HTML directory, and the PHP scripts run! So, I'm on to the next step. Sorry to bother you all.

  7. mcgoy
    Member
    Posted 8 years ago #

    About the original post to this thread: I would check to see if vim thougth the file to be "DOS" This happens with cgi perl scripts when samba is running and one is using notepad or something on a windows box to edit the file on the unix machine. Since unix only needs a <LF> and DOS needs both <CR><LF>, files edited on windows but ran under unix will have an invisible <CR> at the end. So, when the shell tries to find /usr/local/bin/php<CR>, it can't.

    Two solutions: with vim, do a :set ff=unix and save the file. Or, create a symbolic link from /usr/local/bin/php to /usr/local/bin/php<CR>

    The last one's my favorite for perl scripts I edit with notepad under windows and save to unix with samba. . .

    Hope that makes up for my stupid post.

Topic Closed

This topic has been closed to new replies.

About this Topic