php executing differently on browser or command line - centos

Good morning guys,
I just built a CentOS server with php 7.0.13 and apache 2.2 and the strangest thing is happening when testing it.
I had a curl script that works perfectly well through the command line but not when invoked through the browser, after investigating a bit, I realized that I can also not write to files if I do it through the browser, but I have no problem whatsoever doing it through the command line.
I assumed that the problem would be on two different php.ini files, but after verifying the phpinfo I realized that both the CL and the browser are loading the same, and all extensions seem to be loading correctly as well, by using get_current_user() I can also verify that the same user is executing both. I would assume the problem would be in apache, but I have no clue as to what could be causing it.
Can someone point out to possible avenues to solve the issue? I have no idea what to do from this point onwards.

As Hassan indicated the problem was with the user executing the script.
I commited an error thinking get_current_user() indicates the user executing the script, it does not, it indicates the file owner.
If you have a similar problem and need to figure who is executing the script use exec('whoami'); instead.
EDIT:Ok although that was one of the errors, the main error was on the fact that SELinux was activated, as soon as I deactivated the scripts started working perfectly.

Related

Unable to start VSCode; suggestions for debugging?

I'm working on a disconnected network, so some options are a bit limited. Also, we have SAs who handle stuff like system updates (so, for instance, it is possible that there was a system update in there that I know nothing about).
However, I had 1.33.1, then 1.34.0, then 1.38 versions of VSCode working on my (Windows 10) machine. One day, for no apparent reason (I hadn't just installed something, for instance), 1.38 stopped working. It wouldn't even start up. Running 'Code --verbose' from the command line produced no output (the mouse cursor turned briefly to a spinner, but nothing even showed up in Task Manager, let alone something like a splash screen).
I did get an error message in the Application log, which included the lines (more or less; remember, no cut-n-paste possible):
Faulting Application Code.exe, version: 1.38.0
Faulting module ntdll.dll, version 10.0.16299.936
Exception code: 0xc0000374
Faulting Application path: c:\Program Files\Microsoft VS Code\Code.exe
Faulting module path: c:\Windows\System32\ntdll.dll
Re-installing VS Code (with or without system restart after uninstall) did nothing.
Removing all extensions (we have a bunch) did nothing
Installing 1.39.2 did nothing
The only good thing is that I can still run 1.34.0, if I reinstall that (did not try 1.33.1, and I don't have any in-between versions from 1.34 to 1.38 to try). So at least I'm not completely shut out.
I also tried deleting basically all of workspaceStorage, to no effect. Nor did renaming my storage.json.
The biggest weirdness, to me, is that the path to ntdll.dll is in System32, rather than in SysWOW64 (is there some way to force usage of the latter?). Second, why did 1.38.0 work just fine for a while, and then stop.
So, I'm curious if anyone else has seen this problem, and/or if anyone has any idea what else could be done to get more insight into what's causing this.
(edit: I plan to file bug for VSCode, but been waiting on confirmation email to finish creating my github acct for some time now. sigh)
I've had exactly the same problem twice. I'd been running the application since June 2019 and then in March of this year, Yep! Exact same problem as you encountered. A simple reinstall fixed that, but I've had the same problem again today and after some investigation, Windows 10 was telling me that I didn't have the right permissions to access the item (this is using the Owner's account!). Attempting to reinstall failed, with errors stating that the file / directory all ready existed and couldn't be overwritten or renamed. Attempting to un-install the application was only partially successful with the executable code.exe still remaining afterwards. The only way I managed fix it this time was to reinstall to a directory with a different name. Surprisingly though, all the existing workspaces, projects and extensions even were intact and the application opened where I had left off as though nothing had happened. This is a little worrying I have to say! But that's how I fixed it this time.

Trying to figure out why eslint-watch doesn't work with docker-compose correctly

I have been trying to get my front-end working on docker for the past day and I have narrowed down some irregular behaviour to eslint-watch and docker. I have recreated a minimal working repo of the bug I am experiencing.
It seems that linting is somehow staggered when using docker-compose (docker-compose up specifically, docker-compose run seems to work fine). Rather the last console log statements are staggered. I am not sure what it is, but from my reading the best interpretation I can give is that the log messages that should be printed out for the linting are for some reason not flushed out of the node message queue.
I have narrowed down the message printing to the eslint watcher file. If I add in more console logs at the end of this method it prints out the linting fine, but it staggers my logs (i.e. the last logs in execution). Funny thing is, if I save again it flushes the rest of the message queue i.e. the previous logs print out.
To replicate, download my repo, run docker-compose up and edit the test.js file and save. Watch the logs in your terminal for the linting. You will see what I mean.
I hope this is descriptive enough, it's a really strange bug and difficult to explain in a question.
Any ideas how I can actually figure this out?
Finally figured this out. iterm of all things was the culprit. Really weird.
Anyway I was using iTerm2 3.0.9. It seems in iTerm2 3.0.12 (OS 10.8+) this bug is fixed.
https://github.com/rizowski/eslint-watch/issues/94#issuecomment-261287265

service fabric local cluster exception from 0x80071BFF

I created a solution with a few applications, and it worked perfectly. But a day later when I was about to debug the solution again, it suddenly cannot start.
I did have firewall and AV disabled, both when it worked and later when it didn't work.
It works fine when deployed to azure, but not locally.
The error thrown is:
Exception from HRESULT: 0x80071BFF
at System.Fabric.Interop.NativeRuntime.FabricGetNodeContext()
at System.Fabric.FabricRuntime.NativeFabricRuntimeFactory.GetNodeContextHelper()
at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func`1 func, String functionTag, String functionArgs)
A related post register-servicefabricapplicationtype-on-a-secure-cluster-always-times-out
describes a similar thing.
However, I get this while debugging locally and with smallest possible application: I even just created 1 application, 1 actor, did no changes, hit F5 and I get this error.
So, I looked at service-fabric-troubleshoot-local-cluster-setup and while I also get the TypeInitializationException, the solution of:
Your path variable was not correctly set during installation. Please sign out of Windows and sign back in. This will fully refresh your path.
did not work at all.
Nothing else on that page seemed to be related.
Now I begin to feel that I've hit the end of what key words I can google, and still I have no idea what to do.
Any help would be greatly appreciated.
EDIT:
I've tried starting via cluster manager and apps can still not start.
I've removed apps, removed cluster, tried with new solutions, over and over. The only thing I haven't tried is reinstalling SDK and VS. I'm a bit reluctant to reinstall VS, so I'd hope to find some clues before resorting to that.
UPDATE1:
Now I reinstalled Service Fabric v. 5.3.311.9590, SDK and Tools.
Created a solution, added a stateless service. Hit F5. The exact same error is thrown.
I will now try to install on another machine with mostly the same configuration.
UPDATE2:
Installed the SDK on an identical VM, Win10, also with VS2015 Update 3. Created solution, added 1 actor, hit F5 and also on this macchine the exact error is thrown.
I tried Debug without debugging (as mentioned here) to attach later. But the application never starts. It is failed. This is the same on both the machines.
It all worked and from one day to the other it doesn't, and it's a problem that I cannot find anywhere on the net. What can this be? I found that the security updates from windows was made about the same date this happened...
I will uninstall and try again.
UPDATE3:
Uninstalling security update was not possible, but I could hide a couple of other updates. To no luck though.
From here I found this https://github.com/Azure/service-fabric-issues/issues/15 and realised I actually was very low on diskspace, and so I increased it (hyper-v manager) to 20 gigs free. But no, still the same problem.

Getting error "Timeouts can be caused by AngularJS services $http and $timeout which fail to complete quick enough."

I have wrote a function which technically and logically is correct and while running it runs perfectly locally. But on server I am getting the above error which I could not figure out. I am on protractor version 1.6.0 as same as server but still not able to figure out what causes this.
Scenario is like, I have created many it functions inside my spec.js. But when I ran my spec starting two it functions execute precisely, but on third it scripts fails with above error on server. But when I ran the same spec on my local system with similar settings and configuration, it runs smoothly. Please give me any suggestion if you have encounter the same issue earlier. You can also share the link of a blog if you have any. I am a newbie. Thanks in advance.
Actually , I did a mistake, when we use non angular locators we have to use findElementDriver instead of findElement. Locally, its runs whithout any issues but on server it gives the above error.

Runtime Error in Visual Simulation Environment - Microsoft Robotics Studio

I am using Microsoft Robotics Studio for a school project and I am getting a strange error when I try to run the Visual Simulation Environment. It was working fine until yesterday and then suddenly it gave me a runtime error saying "Illegal command line arguments... do not use VPLHost directly, use dsshost instead to run a manifest" But I am only clicking on Run in VPL/DSS Manifest editor.
I am running MRDS as administrator and I even tried re-installing MRDS but it is still showing the same MS VPL Runtime error. I tried to search online, but cannot find any suitable solution.
I already tried running the existing samples, I.e. Urban Environment, Multiple Simulated Robots etc. but it still gives me the same error. The strange thing is that it was working perfectly one minute, and then started giving me this error message the next minute, when I had not changed anything in between. In fact, I had wanted to change something in my manifest, so I closed the running VPL application, closed VPL and opened DSS manifest editor, and ran my manifest and that is when I got this error.
What is going wrong? Is some MRDS script using vplhost32.exe instead of dsshost? If so, then where and how do I change it?
I tried running the urban envrionment manifest from the command prompt and Using DSSHost32 directly. This time, it didn't give me a runtime error but an intiialization error. I tried changing port numbers but it still doesn't work. I have deleted many files from my computer to free space (JIC) and it still doesn't work. The window just doesn't open even when I hover over it in Windows 7.
The error message looks like this: Only one usage of each socket address (protocol/network address/port) is normally permitted."
This was even after I checked netstat for free ports and tried but I get this error message. Its either this one or the "Don't use VPLHost directly" if I run it through VPL or DSS Manifest Editor.
Could it be that some external services are interfering with DSSHost/VPLHost? Are there any such services which I could try killing? ANY help/suggestion would help right now as my project is due Thursday and this is a really unfortunate time for it to be acting up like this.
Does the problem reproduce after logging off & logging back on? It's likely that you had a process hanging around that you weren't aware of. Logging off should shut down any processes you personally started.
I don't know the solution of your problem, but it would be better that you post your question on the link below:
http://p2p.wrox.com/book-professional-microsoft-robotics-studio-isbn-978-0-470-14107-6-410/
[official forum for the book : Professional Microsoft Robotics Studio], i hope you will shortly get reply there,
The other option is to post your question on the msdn forum,
http://social.msdn.microsoft.com/Forums/en-US/category/robotics
hope this would help....