PHP caching - am I missing something obvious? - php

Let me preface this with; I do not work with PHP. The code below is something that we inherited and look after. It talks to Google Sheets to display information onto some TV's around an office, and thats it. The company who set this up originally have ceased trading, so we can't go to them for information or ask them how to fix it, so I thought I'd come here.
Whenever I go to http://ServerIP/FileName.php?u=Sales/ it returns the error "Google failure and nothing to display from cache" which is defined near the bottom of the code, however, I've no idea how to get it work. I can also see on line 62, there is this - "${${"GLOBALS"}["kjvieqjie"]}="cache/".${${"GLOBALS"}["bjlwuz"]};" which I've tried to change to c:/Xampp/htdocs/cache and to no avail.
This runs from a Windows Server running Xampp - ive ensured that in the folder the php file lives in, there is a folder called "Cache" and that read/write permissions are set to full control for the Everyone group, so i can't see this being a permission issue, but i could easily be wrong.
Code can be found here
Any help would be greatly appreciated, and if you need anything to assist with the resolution of this, let me know :)

Related

How can I get CPU Usage with PHP on Windows IIS 8.5? (2012 R2)

What I'm looking for is an easy way to get either individual core usage or total CPU usage for the system that the PHP Script is running on.
However I'm unable to do so. I've looked all over for all manner of solutions from using perf (with and without passthru) to using winmgmts through COM.
The issue is, some of these will work on Windows if you use Apache, but with IIS the security restrictions stop PHP from being able to use for example winmgmts through COM so I just get back a null object.
How can I solve this? - I've honestly tried every solution I can find on the internet and while there is lots of information about how to raise the permissions all the guides point to IIS 7 or earlier and are no longer applicable to IIS 8.5 with literally the suggested option changes being non-existent.
If anyone could help me with this I'd be really appreciative, a workaround like using a third party application that could provide this data would also be acceptable if I can query the data through PHP either from a file or network etc Even a asp.net script that I could query? (I don't know anything about asp.net but I could use it for this single thing if it'd work?)
Thank you.
I managed to solve this and I hope it helps someone else.
What you must do is convert the folder where your PHP (or asp) will execute to an Application. So the structure will look like this:
Website Name
-> Application Name
Then you want to select the parent folder, the Website Name folder and go to "Basic Settings" in the far right actions pane and select "Connect As..." and connect as an Administrator account.
Once you've done this the application will inherent the credentials you specified on the parent website folder and you'll now have full access to perf, wmi and so on.
If you only give the credentials directly to the application it doesn't work and it also doesn't work if you don't convert your folder where your scripts will execute to an application. This is where I was being tripped up and the documentation online is very sparse.
I'd like to thank the good people at the phpsysinfo github for their IIS documentation which pointed me on the right track on needing to convert a site to an application which was part of the puzzle I was missing.

PHP Session saves but cannot be loaded again?

I dont know what to do, on my local LAMP stack and my other server's LAMP stack it work perfectly fine so I have no clue why it wouldn't on my main server. At the start, I thought that the sessions werent saving properly so I found out what folder they saved to, went to it and found an empty sess_... file and a small sess_... file that is 67B. I checked the big one and it contains the right information but the client is obviously for some reason getting the 0B one, does anyone know a fix for this?
I can provide code if necessary but I dont see how it would be.
I just tested it on Edge instead of Chrome and that somehow seems to work, I have absolutely no idea what is going on

MediaWiki Main_Page not shown

I've messed up a little bit with my php cms insallation and now I've problems loading the mediawiki Main_Page and I don't exactly know why. The error thrown by the server is a simple 404, so it doesn't explain that much to me. The only thing that could help me find out the solution is that I changed the virtual host configuration a couple of times in the server (Apache 2.4).
I'm guessing the problem is there but I don't have any further clue about how to solve it.
Has anyone experienced something like this?
I've to add that this is not a short URL problem, as i'm not trying to redirect the articles pages to a specific url, so this shouldn't be useful in my case.
From the information you provided, i guess you got some error in your pathing.
Have you tried running it locally via e.g. Mamp ?
Play around with you local_settings especially $wgScriptPath and $wgStylePath.
The error can usually be found in there, and fixed in there. I have been working with MediaWiki the last couple of weeks. If you provide some more info, i might be able to help you some more.

What is causing my PHP file to display the code, instead of executing it?

I know a lot of you guys are going to get angry, because it seems like so many questions have been based on this alone!
But, I have checked my PHP tags, all of which are using <?php..., PHPMyAdmin is installed on my server.
I just don't understand what's causing this? T_T
ftp://ftp.wagermatches.net/public_html/arithia/referral/test/home.php
I've tried changing the URL from ftp:// to...
http://ftp.wagermatches.net...
http://www.wagermatches.net...
http://www.wagermatches.net/arithia/referal...
I tried adding a .htaccess file to my server...
I'll be getting into my server classes two months from not, but I have no clue what's wrong. If you've got any idea, could you please point me to tutorials on how to do something and not just what I need to do? I am still learning. :( Thank you guys for your help!
Accessing the file through FTP will not cause it to be interpreted. Instead, you will get the file literally as you are now.
If you wish the file to be interpreted, you must first access it through HTTP and then configure your server to interpret it. How to do that depends on the web server you are using. As is, you’re getting an internal server error, which means that something is wrong with your server’s configuration. A good first step to diagnosing the problem would be to check the error log, as the internal server error page says.
Your server is not recognizing the php tags, so I think you do not have PHP installed. Note: I am not talking about PHPMyAdmin !!!

Migrating Silverstripe CMS system from one server to another

Im relatively new to silverstripe cms and Im trying to move a site to a new host.
I followed all the instructions I could find on their official forums but to no avail.
Here is what I mean.
Here you can see what the site should look like
http://www.efekto.co.za
But this is what it looks like after I have moved it (copied everything to my public_html folder on the new site, set up the db username and passwords etc)
Please help cause I'm utterly and truly stuck at the moment.
Since someone else initialy moved the site so I decided to delete everything and move everything myself. Its hard to explain otherwise what I have tried or not tried.
First I tried to install just a base silverstripe. Got that right pretty much but only after I specified the database ip as 127.0.0.1 and not the external ip. So I deleted the base install again, copied over all the site files again and this time modified the db params to use 127.0.0.1 Some of the pages now actually reflect valid content but it seems that everything is not this light blue kind of color (seems to be a default of SS? ) It is as if it's missing some kind of master page or something as I can see content, but no module thingies like menus, blog section etc.
I also have to mention that to test this I change my hosts file so that www.efecto.co.za resolves to the sites new ip address with our new host. So from my machine it resolves to new ip but from the servers perspective when it fetches things like css its obviously going to fecth it from where www.efekto.co.za is currently hosted. Hope that makes sense?
So 1 step in the right direction at least. We have content and no more errors. Now whats up with this blue color scheme??
http://www.efekto.co.za seems to be fine now.
My guess: You've had a silverstripe-cache folder on your old server, which you've copied. It contains (as you might suspect) cached files with absolute paths. If your path structure is not exactly the same on both servers, you will run into problems. So always remove everything from the cache folder when moving sites around.
If that isn't the problem, take a look at the Apache log file (probably /var/log/apache2/error.log, but this can vary). As it's a server error, it should tell you what the problem is...
Check the error log in cpanel or whatever, perhaps a PHP or APACHE directive is different on this server. You'll find out from the logs what the problem is.
I got this once and the problem was that /dev/build wouldn't run because the php memory upper limit was set higher in SS than it was on the server.
Also go into _config and set the environment directive to 'debug', this will display as much output as SS can give you on the page.

Categories