Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not saving files on server? #8

Open
amunizp opened this issue Feb 1, 2014 · 11 comments
Open

not saving files on server? #8

amunizp opened this issue Feb 1, 2014 · 11 comments

Comments

@amunizp
Copy link
Member

amunizp commented Feb 1, 2014

hi! i realized I have some server space with vigin media an tried to run this on it.
amunizp.webspace.virginmedia.com/
it does not work because the code saves files the server.
a) how do I change this
b) i was thinking to change the code to avoid having to save file? i propose doing a branch that does not merge.

@amunizp
Copy link
Member Author

amunizp commented Feb 1, 2014

by a) i mean how do I make my server let my php code save stuff?

@woodscooter
Copy link
Contributor

I'm still not entirely sure what you mean. But let's start here:

You need to upload the php code to your webspace using an FTP client. I
use Filezilla -it's a free download if you do not already have it.

Using Filezilla, or other, upload the php to:
ftp.webspace.virginmedia.com, using your username and password as set up
for the webspace.

Then if the uploaded file was countdown.php, you can see it run at
http://amunizp.webspace.virginmedia.com/countdown.php

Now, if you knew all that already, then I have missed the point, and you
may be asking how to make a php file save (for instance) a text file at
the server for it to read later on at another time.

I'll wait for your response to this post.

-- Ian.

On 01/02/14 21:18, amunizp wrote:

by a) i mean how do I make my server let my php code save stuff?


Reply to this email directly or view it on GitHub
#8 (comment).

@amunizp
Copy link
Member Author

amunizp commented Feb 2, 2014

Point b

On 2 de febrero de 2014 11:28:04 GMT, woodscooter [email protected] wrote:

I'm still not entirely sure what you mean. But let's start here:

You need to upload the php code to your webspace using an FTP client.
I
use Filezilla -it's a free download if you do not already have it.

Using Filezilla, or other, upload the php to:
ftp.webspace.virginmedia.com, using your username and password as set
up
for the webspace.

Then if the uploaded file was countdown.php, you can see it run at
http://amunizp.webspace.virginmedia.com/countdown.php

Now, if you knew all that already, then I have missed the point, and
you
may be asking how to make a php file save (for instance) a text file at

the server for it to read later on at another time.

I'll wait for your response to this post.

-- Ian.

On 01/02/14 21:18, amunizp wrote:

by a) i mean how do I make my server let my php code save stuff?


Reply to this email directly or view it on GitHub

#8 (comment).


Reply to this email directly or view it on GitHub:
#8 (comment)

Enviado desde mi teléfono con K-9 Mail.

@woodscooter
Copy link
Contributor

I have just taken a look at
http://www.amunizp.webspace.virginmedia.com/kml-tfl-countdown/countdown.php
and the php file is saved on the server ok, isn't it? I still don't
understand what is the problem.

Do you want the server to run the php from github? That's just not
possible. For security reasons the virginmedia server will only run
files that are hosted on virginmedia. You can have a link to github,
but github is not a web server, so you can't run php on it.

Am I getting any closer to answering the question?

On 02/02/14 11:30, amunizp wrote:

Point b

On 2 de febrero de 2014 11:28:04 GMT, woodscooter
[email protected] wrote:

I'm still not entirely sure what you mean. But let's start here:

You need to upload the php code to your webspace using an FTP client.
I
use Filezilla -it's a free download if you do not already have it.

Using Filezilla, or other, upload the php to:
ftp.webspace.virginmedia.com, using your username and password as set
up
for the webspace.

Then if the uploaded file was countdown.php, you can see it run at
http://amunizp.webspace.virginmedia.com/countdown.php

Now, if you knew all that already, then I have missed the point, and
you
may be asking how to make a php file save (for instance) a text file at

the server for it to read later on at another time.

I'll wait for your response to this post.

-- Ian.

On 01/02/14 21:18, amunizp wrote:

by a) i mean how do I make my server let my php code save stuff?


Reply to this email directly or view it on GitHub

#8 (comment).


Reply to this email directly or view it on GitHub:
#8 (comment)

Enviado desde mi teléfono con K-9 Mail.


Reply to this email directly or view it on GitHub
#8 (comment).

@M0TZO
Copy link
Contributor

M0TZO commented Feb 2, 2014

It's probably not setup with the right resources to run the file. If you
email me I'll upload to the website.

Next time I'm at little house & one or both of you are there I'll setup to
give you access directly.

Paul G

Sent from my iPhone

On 2 Feb 2014, at 11:45, woodscooter [email protected] wrote:

I have just taken a look at
http://www.amunizp.webspace.virginmedia.com/kml-tfl-countdown/countdown.php
and the php file is saved on the server ok, isn't it? I still don't
understand what is the problem.

Do you want the server to run the php from github? That's just not
possible. For security reasons the virginmedia server will only run
files that are hosted on virginmedia. You can have a link to github,
but github is not a web server, so you can't run php on it.

Am I getting any closer to answering the question?

On 02/02/14 11:30, amunizp wrote:

Point b

On 2 de febrero de 2014 11:28:04 GMT, woodscooter
[email protected] wrote:

I'm still not entirely sure what you mean. But let's start here:

You need to upload the php code to your webspace using an FTP client.
I
use Filezilla -it's a free download if you do not already have it.

Using Filezilla, or other, upload the php to:
ftp.webspace.virginmedia.com, using your username and password as set
up
for the webspace.

Then if the uploaded file was countdown.php, you can see it run at
http://amunizp.webspace.virginmedia.com/countdown.php

Now, if you knew all that already, then I have missed the point, and
you
may be asking how to make a php file save (for instance) a text file at

the server for it to read later on at another time.

I'll wait for your response to this post.

-- Ian.

On 01/02/14 21:18, amunizp wrote:

by a) i mean how do I make my server let my php code save stuff?

Reply to this email directly or view it on GitHub

<
#8 (comment)
.


Reply to this email directly or view it on GitHub:

#8 (comment)

Enviado desde mi teléfono con K-9 Mail.

Reply to this email directly or view it on GitHub
<
#8 (comment)
.

Reply to this email directly or view it on
GitHubhttps://github.com//issues/8#issuecomment-33898369
.

@amunizp
Copy link
Member Author

amunizp commented Feb 2, 2014

Hi Paul, thanks for your help.

I uploaded the PHP code to my virgin media FTP just as Ian said.
http://www.amunizp.webspace.virginmedia.com/kml-tfl-countdown/countdown.php
The code is exactly like the one on the final version of countdown.php. In fact I take the same code an run it in my local host and it runs fine.

But in the virgin media webspace I get


Buses from Kingston MakerLabs

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /tier-11/pwpstore1/42/amunizp/htdocs/kml-tfl-countdown/countdown.php on line 49

Warning: file_get_contents(http://countdown.tfl.gov.uk/stopBoard/51750): failed to open stream: Resource temporarily unavailable in /tier-11/pwpstore1/42/amunizp/htdocs/kml-tfl-countdown/countdown.php on line 49

Fatal error: Call to undefined function: json_decode() in /tier-11/pwpstore1/42/amunizp/htdocs/kml-tfl-countdown/countdown.php on line 50

@amunizp
Copy link
Member Author

amunizp commented Feb 2, 2014

It seems to me as if virgin media does not allow to go fetch things from elsewhere? or maybe it has to do with the fact that virgin media webspace runs on php version 4.3?

@woodscooter
Copy link
Contributor

I think you are right -it's a virgin media issue, or rather two issues.

They may have disabled php from accessing a URL with
file_get_contents(). There's a switch to allow/disallow this in
php.ini, which you would not be able to change. Incidentally,
file_get_contents IS included in php 4.3 and above.

Also, the function json_decode() is not known. That function was
introduced in php 5.2, so it is a no-no for php version 4.3

On 02/02/14 16:36, amunizp wrote:

It seems to me as if virgin media does not allow to go fetch things
from elsewhere? or maybe it has to do with the fact that virgin media
webspace runs on php version 4.3?


Reply to this email directly or view it on GitHub
#8 (comment).

@amunizp
Copy link
Member Author

amunizp commented Feb 3, 2014

thanks Ian, spot on! thanks for your help!
seems I will have to find something else to make it work, go client side app or just work on something different.

@woodscooter how did you figure this out? i thought I had look in phpinfo() did i miss it?

@woodscooter
Copy link
Contributor

It all starts from the php error message:

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo
failed: Temporary failure in name resolution in
/tier-11/pwpstore1/42/amunizp/htdocs/kml-tfl-countdown/countdown.php
on line 49

Warning:
file_get_contents(http://countdown.tfl.gov.uk/stopBoard/51750): failed
to open stream: Resource temporarily unavailable in
/tier-11/pwpstore1/42/amunizp/htdocs/kml-tfl-countdown/countdown.php
on line 49

Fatal error: Call to undefined function: json_decode() in
/tier-11/pwpstore1/42/amunizp/htdocs/kml-tfl-countdown/countdown.php
on line 50

First error, well, it's a warning to be precise, is file_get_contents()
failed. Look up that function in the manual at
http://uk3.php.net/manual/en/function.file-get-contents.php [note:
.../manual/es/... will give it in Spanish]

Reading that manual page, under Notes it says "Tip. A URL can be used
as a filename with this function if..."
and there's a link to another manual page that describes
"allow_url_fopen" as a configuration directive.

It helps that I have seen this restriction before now, so I knew what I
was looking for.

Secondly, the php error message says "Fatal error: Call to undefined
function: json_decode()" so I looked that function up in the php manual
at http://uk3.php.net/manual/en/function.json-decode.php

The first line under the title tells what version of php you need, and
this time it says >=5.2.0

So you see, without the online php manual, I would know nothing!

--Ian.

On 03/02/14 07:05, amunizp wrote:

thanks Ian, spot on! thanks for your help!
seems I will have to find something else to make it work, go client
side app or just work on something different.

@woodscooter https://github.com/woodscooter how did you figure this
out? i thought I had look in phpinfo() did i miss it?


Reply to this email directly or view it on GitHub
#8 (comment).

@amunizp
Copy link
Member Author

amunizp commented Feb 3, 2014

This is great stuff, thanks!

On 3 de febrero de 2014 10:43:50 GMT, woodscooter [email protected] wrote:

It all starts from the php error message:

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo
failed: Temporary failure in name resolution in
/tier-11/pwpstore1/42/amunizp/htdocs/kml-tfl-countdown/countdown.php
on line 49

Warning:
file_get_contents(http://countdown.tfl.gov.uk/stopBoard/51750):
failed
to open stream: Resource temporarily unavailable in
/tier-11/pwpstore1/42/amunizp/htdocs/kml-tfl-countdown/countdown.php
on line 49

Fatal error: Call to undefined function: json_decode() in
/tier-11/pwpstore1/42/amunizp/htdocs/kml-tfl-countdown/countdown.php
on line 50

First error, well, it's a warning to be precise, is file_get_contents()

failed. Look up that function in the manual at
http://uk3.php.net/manual/en/function.file-get-contents.php [note:
.../manual/es/... will give it in Spanish]

Reading that manual page, under Notes it says "Tip. A URL can be used
as a filename with this function if..."
and there's a link to another manual page that describes
"allow_url_fopen" as a configuration directive.

It helps that I have seen this restriction before now, so I knew what I

was looking for.

Secondly, the php error message says "Fatal error: Call to undefined
function: json_decode()" so I looked that function up in the php manual

at http://uk3.php.net/manual/en/function.json-decode.php

The first line under the title tells what version of php you need, and
this time it says >=5.2.0

So you see, without the online php manual, I would know nothing!

--Ian.

On 03/02/14 07:05, amunizp wrote:

thanks Ian, spot on! thanks for your help!
seems I will have to find something else to make it work, go client
side app or just work on something different.

@woodscooter https://github.com/woodscooter how did you figure this

out? i thought I had look in phpinfo() did i miss it?


Reply to this email directly or view it on GitHub

#8 (comment).


Reply to this email directly or view it on GitHub:
#8 (comment)

Enviado desde mi teléfono con K-9 Mail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants