Forum Moderators: phranque

Message Too Old, No Replies

vnd.ms-excel problem

server does not process script for excel output

         

kathanon

5:25 pm on Oct 5, 2004 (gmt 0)

10+ Year Member



Hi I wonder if anyone can help

I have moved a site to a new server and now a php script that should output excel does not work anymore.

The data is there and should be produced by a file called csvout.php,normally clicking on a link on the main page with all the data, will output the data as csv and give an option to save or open a file. The php script that is called has the following code:

<?php header("Content-Type: application/vnd.ms-excel");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
require_once('../Connections/database.php');?>
<?php

This still works on the old server, but on the new is producing this error. I have put the files that do not work on the new server, back onto the old server (I have no access to the configuration to see how it is configured differently) and they work. So I am pretty sure it is server specific but otherwise am in the dark.

The only other thing I thought of was the MySQL database, this has also moved and I have just added all the old tables and content

The link that should call the above script now gives the following:

Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster

I have added an .htaccess file in the root of the site with the following AddType application/octet-stream xls but it has not made any difference. The path is var/www/html

Any pointers would be very gratefully received as I need to get this working for a project.

Many thanks

Kathy

jdMorgan

6:03 pm on Oct 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Kathy,

Welcome to WebmasterWorld!

Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster

This does not sound like a MIME-type problem. It sounds like the server can't find the script or one of its includes. Check your server error log and look carefully at the URL the server tried to fetch when it got the error. This will give you an indication of what the problem might be. You may be missing a needed URL rewrite or an Alias directive that was configured on your old server, and so the actual script path is incorrect. It's quite common to alias executable script directories, for example.

Jim

kathanon

7:34 pm on Oct 5, 2004 (gmt 0)

10+ Year Member



Dear Jim

Thank you for the welcome and for the reply.
Yes, that sounds as if it might be nearer the problem.

Since posting, I have tried accessing some other pages which rely on scripts and connections to the database (although all of the main pages work i.e.the ones which only connect to the database) I need to access some pages that seem to rely on another script and connection to the MySQL dbase. I am getting the following errors here. A straight down and upload was done from one server to another, so I a bit at a loss, the page works still on the old server.

Warning: Access denied for user: 'conference@localhost' (Using password: YES) in /var/www/html/adodb/drivers/adodb-mysql.inc.php on line 182

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/adodb/drivers/adodb-mysql.inc.php:182) in /var/www/html/conf2004/index.php on line 4

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/adodb/drivers/adodb-mysql.inc.php:182) in /var/www/html/conf2004/index.php on line 5

One thing I have wondered is whether the directory path is correctly configured. The hosting company recommended var/www/html as the root, and after a couple of failed attempts we managed to get the home page etc there. (I think) at least that is where the files appear to be. Mind you, when I connect with ftp, the directory the domain name connects directly to is /home/admin and I have to go up two levels to get to the top level, and from there go to the var folder where the site files are. Is this normal?

I am reading up now on Apache configuration but am unclear about where in relation to our own paths this should be At present the serverscripts are here - var/www/html/includes but the cgi-bin is one level above this. Where should the alias point and is does anyone know a good tutorial about how to configure it

I am very new to this (learning fast though!)so please forgive me if not everything here is relevant.

Thank you

Kathy

jdMorgan

7:54 pm on Oct 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've never worked with your configuration, either, so hopefully someone who has will drop in. However, almost all hosting configurations are different, and if this is a path problem, your configuration is likely to be fairly unique.

About all I can do is to direct you to the Apache Web site [httpd.apache.org], and recommend you take a look at the Alias [httpd.apache.org] and ScriptAlias [httpd.apache.org] directives and their variants.

Jim