Forum Moderators: coopster

Message Too Old, No Replies

Using a PHP file

I'm new here and need help with this news script that i'm trying to use.

         

FoxFire

12:50 am on May 12, 2004 (gmt 0)

10+ Year Member



Hi. I need a bit of help with something. I'm creating a FTP site for a MessageBoard that I'm a member to. I'm not that skilled with HTML & Web Designn, but I have a team that I get help from comprised of other members from the messageboard in various aspects for the site. One of the things that I'm trying to setup is a news script that will go on the main page. Here's what it tells me to do:

("All you have to do is upload all files that are in the subfolder "upload" of this zip package, to a folder (eg. "news") on your server. Then CHMOD this "news" folder to 777. Now run the installer script (installer.php) from that location and install Fusion News.

The installer will guide you through CHMODding and configuring the script.")

Where i'm stuck is running the installer script, the 'installer.php' file. Exactly how do I do that?

(Note: I am using Frontpage 2003 to build the webpage.)

jatar_k

1:21 am on May 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld FoxFire,

I assume your website supports php

you can just upload it to the server and then call it in your browser of choice.

You will probably have to get an ftp program to upload it as opposed to letting frontpage handle things like that.

steps

1. get an ftp program
2. configure it to connect to your website (domain, username, password)
3. create a new directory on your web server, as mentioned in the documentation
4. chmod that directory to 777 (read, write and execute for everyone)
5. upload the specified files to the web server
6. call the 'installer.php' file in your browser and follow any instructions there in

FoxFire

4:19 am on May 12, 2004 (gmt 0)

10+ Year Member



Thanks a lot. That worked perfectly.
Unfortunately, i've run into another snag, and I have no idea why. Here's what I got (minus the "---" lines of course. heh.):
------------------------------
Warning: main(http://soahftp.hxcnet.com/news/news.php): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/public_html/main1.php on line 71

Warning: main(): Failed opening 'http://www.mysite.com/news/news.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/public_html/main1.php on line 71
----------------------------------------

Can anyone make any sense of it?

Here's a bit of extra info on how I came to this:
I followed through & ran the installer.php file.
The process consisted of setting the CHMOD settings for many of the files & folders inside of the uploaded /news folder. I set all of the CHMOD settings accordingly to it's check-list, and it even checked all of the settings to make sure that it was working before allowing me to continue. Once that was done, I proceeded to setting up my account info and then logged in. I then proceeded to erase the old news I had on the site (which was just raw text) and replace it with this code in the layer of the site that I had the news: <?php include "http://www.mysite.com/news/news.php";?>
I then followed through with changing the page name from main1.htm to main1.php (Of course, Frontpage 2003 doesn't support php save files so I'm no longer able to design & preview that page, just code it raw and view it by uploading it to the server via ftp.

(The site is not linked anywhere on the site. It's only uploaded for testing reasons until I actually get it working, but hopefully this wil lgive you a visual understanding on the issue.

[edited by: jatar_k at 5:04 am (utc) on May 12, 2004]
[edit reason] no personal urls thanks [/edit]

jatar_k

5:08 am on May 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



those errors mean it can't find the file

<?php include "http://www.mysite.com/news/news.php";?>

it might be that, includes work via file system and not always via http, try this one

<?php include $_SERVER['DOCUMENT_ROOT'] . "/news/news.php";?>

>>just code it raw and view it by uploading it to the server via ftp.

that's what we all do :)

FoxFire

5:54 am on May 12, 2004 (gmt 0)

10+ Year Member



I replace the old code with the one that you gave me and it gave me this error message:
Warning: main(/home/hxcnet/public_html/soahftp/news/news.php): failed to open stream: No such file or directory in /home/hxcnet/public_html/soahftp/main1.php on line 71

Warning: main(): Failed opening '/home/hxcnet/public_html/soahftp/news/news.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/hxcnet/public_html/soahftp/main1.php on line 71

Then, I looked a minute to take a look at the code carefully to see if I was missing anything:
<?php include $_SERVER['DOCUMENT_ROOT'] . "/news/news.php";?>
I noticed the 'DOCUMENT_ROOT' area and thought that maybe I should put the root destination of where the document is located, so I replaced the inside of that bracket with this: 'http://my.website.com/news' , so the code looked like this:
<?php include $_SERVER['http://my.site.com/news'] . "/news/news.php";?>
(Of course, I used my actual site name. I just changed the url for this forum since that appears to be a rule.

Anyways, it showed me this much different error:

Warning: main(): open_basedir restriction in effect. File(/news/news.php) is not within the allowed path(s): (/home/hxcnet/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/hxcnet/public_html/soahftp/main1.php on line 71

Warning: main(/news/news.php): failed to open stream: Operation not permitted in /home/hxcnet/public_html/soahftp/main1.php on line 71

Warning: main(): Failed opening '/news/news.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/hxcnet/public_html/soahftp/main1.php on line 71

Now just to clarify, I have checked the FTP and the file is indeed in the /news folder. Like I said before, the news installer.php file did a chmod check to make sure all files were present and were CHMOD correctly before even allowing me to create my account info for the site, so I know for a fact that it's not a case of a missing file.

jatar_k

6:15 am on May 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try the include this way then

<?php include "/home/hxcnet/public_html/soahftp/news/news.php";?>

it still can't find the file

jatar_k

6:25 am on May 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



from watching the changing error messages it seems there are a few issues with the path

try this maybe

<?php include "../news/news.php";?>

FoxFire

6:41 am on May 12, 2004 (gmt 0)

10+ Year Member



Yay! The first one got it! I can finally see the news script!
^_^
Thanks a lot! That was really confusing me, especially since I know virtually nothing about php. heh.

By the way, do you think you could help me with another issue? I posted it here. (This link is within the forum)
[webmasterworld.com...]

That's a seperate issue that i'm experiencing, though it deals with the same website.

Thanks again for helping me through this!