elias Posted February 25, 2006 Share Posted February 25, 2006 Hi guys and galsI hope you are all enjoying this weekend.I am messing around with my raw logs and am having a bit or a problem accessing them in the first place...I am doing tests with the following code:[code]$handle = fopen("http://www.domain.com/uploads/accesslog_domain.com_2_25_2006.gz", "r");[/code]which works fine when I manually place the logs in this "uploads" directory, but that is not where they normally reside, when I go to my cPanel and ask to view them, I am sent to:"http://www.domain.com:2082/getaccesslog/accesslog_domain.com_2_25_2006.gz"to download them.What I would ideally want is for my script to access the logs directly here, hence something like this is what I tried:[code]$handle = fopen("http://www.domain.com:2082/getaccesslog/accesslog_domain.com_2_25_2006.gz", "r");[/code]But as luck would have it, it gives me a error something like:[i]Warning: fopen(http://www.domain.com:2082/getaccesslog/accesslog_domain.com_2_25_2006.gz) [function.fopen]: failed to open stream: HTTP request failed![/i]So, I imagine that the php code cannot access the file because it is referred to with port number... and here I am lost.Does anyone know how I could access the file from teh script - I can dowload it if I just copy and paste the [a href=\"http://www.domain.com:2082/getaccesslog/accesslog_domain.com_2_25_2006.gz\" target=\"_blank\"]http://www.domain.com:2082/getaccesslog/ac...om_2_25_2006.gz[/a] url, so there is no problem with the file as such, its the script's ability to access it.Anyhow, I hope someone can point me in the right direction.take care and all the bestelias Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted February 25, 2006 Share Posted February 25, 2006 You have to login to use cPanel, and therefor access your logs.Because of that you will not be able to directly access them from php, at least not to my knowledge. You may consider looking more indepth at cURL, as I am not terribly familiar with it's full capabilities.[a href=\"http://us3.php.net/manual/en/ref.curl.php\" target=\"_blank\"]http://us3.php.net/manual/en/ref.curl.php[/a] Quote Link to comment Share on other sites More sharing options...
elias Posted February 27, 2006 Author Share Posted February 27, 2006 [!--quoteo(post=349390:date=Feb 25 2006, 10:48 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Feb 25 2006, 10:48 PM) [snapback]349390[/snapback][/div][div class=\'quotemain\'][!--quotec--]You have to login to use cPanel, and therefor access your logs.Because of that you will not be able to directly access them from php, at least not to my knowledge. You may consider looking more indepth at cURL, as I am not terribly familiar with it's full capabilities.[a href=\"http://us3.php.net/manual/en/ref.curl.php\" target=\"_blank\"]http://us3.php.net/manual/en/ref.curl.php[/a][/quote]Hi hitman6003Thanks for your help, but unfortunately I have no access to the PHP server - I am just a mere paying customer, and hence I have no possibility to install any extra libraries etc. as stipulated in your link.Also, I am aware that the cPanel needs user access, but I thougth that once I had logged-in into my cPanel area, I did not need to reenter my user name and password again, in fact once I am in a session in my cPanel area, I can copy/paste the URL of where the raw logs are and I can access them with my browser with no problem. I guess the question arises if from where the code is being run, does it have access to my session...?? dunno, and this is where my knowledge hits a wall.Basically, for anyone else reading this post anew, once in a cPanel session, I can access the raw logs file:[a href=\"http://www.domain.com:2082/getaccesslog/accesslog_domain.com_2_25_2006.gz\" target=\"_blank\"]http://www.domain.com:2082/getaccesslog/ac...om_2_25_2006.gz[/a]but the code I have prepared to read this file cannot.Any other ideas, like do any "server-masters" know which is the actual path of this file, like I tried:"/home/mydomain/public_html/getaccesslog/accesslog_domain.com_2_25_2006.gz"but it was clearly wrong... through my FTP access I cant find (I have no access to) the directory "getaccesslog" but does anyone know where these raw logs reside???cheers and TIA againelias Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.