View Full Version : Need help publishing site

06-15-2010, 08:15 PM
Hello again DDForums.

Today, I am running into an issue with launching my static HTML pages on the PHP servers chosen by my company to host our page - I have only a basic understanding of PHP use and functionality, and really all I want is to move the page I am building from my personal domain (www.rainescreative.com/photo/ayrenew) to their servers at cybrhost. At this point in the development there are no dynamic features being added to the site (This is my understanding of the intent of a PHP environment anyway).

I used fetch to remove the placeholder site they had up previously, and then published my site through dreamweaver to the same directory on the FTP, but after the site had propagated, the domain displays nothing but a blank html document.

I contacted the hosting company, and they told me that the site structure seems to be intact. They also loaded the following:

uploaded a index.htm and loads fine:

also uploaded a test php page and that too load properly:

The blank page that is loading is my index.php but that isn't loading any content:

They then suggested I look at the code in my index.php file, but I honestly have no idea how this should look.

I just want my HTML to display on the proper domain! Seems like it should be a simple fix...

Please advise! Any help is *greatly* appreciated, as I feel like I am trying to translate ancient Sumerian here. :confused:

(My previous questions regarding this site are on the following thread: http://www.dynamicdrive.com/forums/showthread.php?p=228969#post228969)

06-15-2010, 08:23 PM
Need to see the source of index.php or did indextest.php have the exact same content?

06-15-2010, 09:50 PM
This is the code in the index.php I took from the old site, licated in my root folder

if (file_exists("./admin/actions/precheck.php"))
$testing_from = "";
require_once "./admin/actions/precheck.php";

require_once 'admin/config/ProjectConfig.php';

/* Init templating engine. See http://components.symfony-project.org/templating/documentation */
$loader = new sfTemplateLoaderFilesystem(dirname(__FILE__).'/admin/templates/website/%name%.tpl.php');
$engine = new sfTemplateEngine($loader);

$helperSet = new sfTemplateHelperSet(array(
new sfTemplateHelperAssets(),
new sfTemplateHelperJavascripts(),
new sfTemplateHelperStylesheets()

$controller = new MotoFrontController($engine);
echo $controller->dispatch();

06-15-2010, 10:51 PM
I wouldn't be surprised if I just went about it in entirely the wrong way. Like I said this is my first brush with PHP/mySQL

06-16-2010, 02:19 AM
you're referencing a lot of external files and functions. Are you sure they're all intact and properly configured?

Does your existing site run on a Content Management System? It looks like you're at least using a MVC framework. If either of these relies on a database (which is likely, e.g., to store the actual site content), then you'd need to move the database to the new server as well. If you have a CMS, it may need to be re-configured or even re-installed.

In any case, if that code is from your old site, you are not dealing with "static html". It's full-blown object-oriented php, and it's entirely "dynamic" - even though it may not look like it from the front-end.

If you're not sure about what you're doing, you'll either learn really quick, or you'll be in for a tough time. I'd recommend you take it slowly and carefully, or you may end up breaking things beyond the point where you can recover them. I don't want to scare or discourage you - but I wouldn't want you to be caught unawares, either.

06-16-2010, 05:57 AM
Honestly, I doubt it. I had nothing to do with the original site that was up, and barely functional to begin with. The original project was only half finished and I have no access to the previous developer. I agreed to put together a clean, simple site for them to replace the old one, and never intended to get involved in this area which I know little about. I designed the site with techniques I was familiar with, and tested it on my own server, on which it worked fine.

I do have the option of having them reset the server to default, perhaps this would be the best way to proceed?

If I do that what would be the simplest way for me to launch this page successfully on this server?

Perhaps someone can guide me to a tutorial? The ones from Adobe I was using seem unrelated to what I'm trying to accomplish. Maybe some day I will start learning more about PHP functionality, but for the time being I just need to get this new page up so the company has more then a blank html representing them.

I appreciate the patience and help you guys are providing, clearly I am a bit over my head at the moment, but I can follow directions and logic, so I have hope yet!

06-16-2010, 07:00 AM
I think you're missing the profound nature of that code: it has absolutely no content and is just referencing a bunch of stuff that may as well be random symbols without the right files supporting it.

That's a bunch of very high level ('abstract') code that is "doing stuff" only in the most remote sense: it's organizing and distributing operations across various other pages in which (or even at lower levels) the actual content is actually stored.

For example:
require_once 'admin/config/ProjectConfig.php';

That calls on "ProjectConfig.php" to run. Then the code in that file executes (we don't know what that is). Then there is a class [aka "complex chunk of code"] called "ProjectConfig" in that file. The line below uses it's "sessionStart()" function, which may do anything, though I'm guessing it sets up your system such as connecting to a database or using some variable presets. Or maybe just starts a PHP session [which stores data for a user througout a visit to your site].
But the guesses are irrelevant: that's all they are for now and aside from random trial and error testing, the only way to understand this is to look through all of the code.

Do you have a working version of this site available? One option here (and if you are very confused, I'd suggest considering it) is that you can ignore all of the current code and start over: visit the pages you want to save (all if necessary), copy the final html output (that is-- what this complex PHP is meant to generate), then start rebuilding the back end in a simpler way that you understand. Or if it's only a few pages just use static html. Of course it's better to have a complex system like this if it actually works, but there's no point at all if it isn't working and the webmaster doesn't know what it's doing or how to fix it.

Honestly, if you don't know what to do at this point, I'd suggest that you stop before you change something crucial (whatever that may be) and hire someone who knows PHP well. Give them full access to your server and they may be able to fix it.
However, even for someone who does know PHP well (like the three of us who have replied), without seeing a lot more it's just a random guess, so it might be easy or it might be very difficult (even impossible) to fix this.

And posting all of the pages needed on here is too much, not to mention that I doubt anyone here really has the time to read through it all for free. If it happens to be an easy fix, that's fine, but if it gets complex (which I think this might), then that won't help much.

If you do want to try to solve this yourself (or potentially give us some more information to try to help, though this may not get very far for the reasons above), there here are some steps:
1. Start by understanding the very basic setup here: what is this code? Is it part of a CMS or other system? Is it custom made? Does it use anything aside from PHP (like a database)? Make a list of these things and you may find that one is an obvious problem.
2. Make sure that ALL errors are being reported by PHP. If you are lucky, this will determine everything you need to know. It takes a little experience to read these errors, but in many cases they can point you where you need to look: they give filenames and line numbers, and some description of the problem. It may be as simple as a typo, or something much more complex, or it may be no error at all (in which case something else is very wrong).
3. Start, very slowly, walking through the code as if you are the program executing. Look at every file and try to figure out what is going on. This may require that you first do some PHP tutorials (or that you hire someone else to work with you).

I don't mean to sound discouraging either, but you do not have a simple problem here. I work with PHP every day and responding to your post is a bit daunting simply because I don't know what to say about that code: I understand what each line is, but I don't understand what it is supposed to "do" because 1. it's part of a complex system specific and unique beyond just "PHP" in general, and 2. it's very incomplete: in this type of situation it sometimes takes tracking an action through 5 files to finally find where something is happening.

Here are three immediate goals for you:
1. Understand the components of the system (mentioned above).
2. Find some errors and begin to fix them or at least understand why they are occurring.
3. Get a general understanding of how everything fits together. For example, this is definitely in every way I'd use the word "dynamic"-- it uses a templating engine, it is generating pages, etc. Why? How?

06-16-2010, 10:45 AM
Hi DallasRaines ! I saw your page the other day (ayrenew.htm) when you where working on your own server. To me it looks like a simple page that could be made with standard html and javascript. I would think that you don't need the php at all, and i am getting the impression that the php you are posting doesn't even belong to your page. In any case it seems like the best option is to make it in plain html and drop all the php stuff for now, as it would get too complicated. I suggest you save your front page with .html extension and try to make it work locally on your pc. After that rename it to index.html and upload it to the root on the new server, then you should be able to see it. If you get that far, post a link and we could take it from there.

06-16-2010, 11:42 AM
Yes, if it's very simple, then you should leave the old PHP behind and start over-- save the needed page(s) and work from there.
Be careful, though-- make sure you aren't losing anything like extra pages, admin options, or whatever else that PHP code might be supporting.

06-17-2010, 11:28 PM
Thank you all so much for your help on this project, as it turned out djr33 and azoomer had it exactly right, basically what the issue boiled down to was my lack of understanding of the very nature of PHP. I was under the impression that I needed an index.php file to make my page work at all on the server, despite the content or lack thereof. Once I figured that out it was a very simple process (purging the old!) to get the page back to a realm within my capabilities. In the process, I have once again managed to learn something, but I wanted you to know I appreciate the time and patience you all showed in helping me get to that point!