Jump to content

Having trouble with forcetype


Manipe

Recommended Posts

I'm having major trouble with a PHP script which is accessed through a forcetype definition in a .htaccess file in the same folder.
When I run the file through the forcetype file path, it gives me the following error:

Parse error: parse error, unexpected $ in 'file' on line 246

But then when i change the contents of the file to a normal PHP file, it works fine and as expected, with no errors at all.
I have isolated the problem code, and have tried putting it in a function to bypass the error, but it still doesn't work.
Because it works as a PHP file, I believe that the problem lies in the apache side of things.

Can anyone help, or has anyone had a similar problem before.

All help is greatly appreciated.  ;)
Link to comment
Share on other sites

  • 3 weeks later...
[quote author=Manipe link=topic=104203.msg415425#msg415425 date=1155562630]
I'm having major trouble with a PHP script which is accessed through a forcetype definition in a .htaccess file in the same folder.
When I run the file through the forcetype file path, it gives me the following error:

Parse error: parse error, unexpected $ in 'file' on line 246

But then when i change the contents of the file to a normal PHP file, it works fine and as expected, with no errors at all.
I have isolated the problem code, and have tried putting it in a function to bypass the error, but it still doesn't work.
Because it works as a PHP file, I believe that the problem lies in the apache side of things.

Can anyone help, or has anyone had a similar problem before.

All help is greatly appreciated.  ;)
[/quote]

Have you tried this? AddType application/x-httpd-php .myextension
'myextension' being whatever extension you are using

If that doesn't work, then it's a problem with your host (a problem I've had in the past). I believe it has something to do with the host not allowing you to override the extensions, or it could be a PHP safe mode protocol. If all comes to worse, you should switch your host.
Link to comment
Share on other sites

[quote author=Manipe link=topic=104203.msg429137#msg429137 date=1157545381]
Thanks to you all, I've fixed it now. I re-uploaded everything and it just worked. Don't know how, but all I know now is that it's working fine. cheers for the help.
[/quote]

Excellent. Let us know if you have any more problems. :)
Link to comment
Share on other sites

[quote author=Manipe link=topic=104203.msg429137#msg429137 date=1157545381]
Thanks to you all, I've fixed it now. I re-uploaded everything and it just worked. Don't know how, but all I know now is that it's working fine. cheers for the help.
[/quote]

Ok thanks for letting us know if you need any other help just ask mate.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.