Jump to content

How do I know whether my server has python installed?


Recommended Posts

Hi,

 

I have part of a server only, and I want to create a sitemap using Google's sitemap generator (python).

 

However, I don't know whether the server has python installed, and which command would run it if it is.

 

Does anyone know how I can find out, and whether, if I just try to run the file, I would do any damage if it isn't installed (I presume not).

 

Thanks

Emma

If you have access to a shell, type...

 

python -v

 

This will determin if Python is installed (its pretty standard on most Linux systems these days).

 

No shell acccess? Put this in a php page.

 

<?php

  $out = shell_exec('python -v');
  echo "<pre>$out</pre>";

?>

Howvever, just because Python is installed does not mean mod_python is built into Apache. You'd need to contact your host to see I think.

Thanks a lot. I think you saved me loads of time - the php page comes back blank ($out is '') so I guess python is not installed (?). Alternatively, perhaps the server is operating in "safe mode" which i keep reading about.

 

In which case, I presume I couldn't run a python script on it anyway. I guess I'll have to make a sitemap some other way.

 

If any of this sounds wrong, please let me know! Otherwise, thanks again for your help.

 

Emma

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.