EDIT
Returning to improve my question and make it useful to others.
I had two major issues here:
1) I didn't understand what composer really is and how to use it
2) I didn't realize I had different pieces of my dev stack running under different users/permissions (as one commentor suggested).
All is well after addressing those gaps in my knowledge. Don't copy tutorials blindly without full understanding!
END EDIT
I want to use PHPMailer in my cloud based software. I downloaded the PHPMailer library using Composer. I setup the SMTP example code replacing all the particulars with my information in a file called testmail.php. When run the script as a test I get:
Warning:
require_once(/var/www/html/appreciate-erp/vendor/autoload.php): failed
to open stream: Permission denied
in /var/www/html/appreciate-erp/testmail.php on line 2
Fatal error: require_once(): Failed opening required
'vendor/autoload.php'
(include_path='.:/usr/share/pear:/usr/share/php')
in /var/www/html/appreciate-erp/testmail.php on line 2
All the other directories in the appreciate-erp directory are accessible by httpd. I have temporarily given rwx permissions to all users in /usr/share/PHP. /Usr/share/pear doesn't exist from what I can tell.
Please help. Does anyone know what might be going on?
Related
I'm trying to use the quickstart and I keep getting this error when I run npm start.
'ENVIRONMENT' is not recognized as an internal or external command,
operable program or batch file.
Can someone help me I'm doing the authentication quickstart.
This question has been asked before and is a duplicate of Beginner Working Through Authentication (Node.js example).
There are some options listed as comments as well as a general answer for Windows users.
I'm using NSSM to run a dotnet core app as a Windows service, which works really well.
However, I've noticed an error when I run nssm install MyAppName, which loads a window to set up the service. When I Select the executable to install, I notice that the following error is written to the console:
CreateDirectory : The system could not find the path specified. (3)
Could not initialize crash reporting DB
Can not init crashpad with status: CRASHPAD_DB_INIT_ERROR[23584]
registry_win.h:59:GetProtoFromRegistryValue Opening registry key Software\Google\DriveFS\Share failed with 0x2
I dont know much about NSSM nor Google DriveFS, but I'm wondering why I'm seeing this message - any ideas? My main concern is whether or not this is trying to access my Google Drive? Probably not - it seems a fairly reputable app, but I figure it's best to ask as someone will likely know better than me.
How can I get ejabberd to run an external auth script on windows?
So far- I've modified the file
C:\Program
Files\ejabberd-15.06\lib\ejabberd-15.06\priv\cfg\ejabberd.yml
to comment out the existing auth_method directive and instead added this:
auth_method: external
extauth_program: "D:\\DROPBOX\\Dropbox (Personal)\\EJABBERD\\auth\\ejabberd-auth.exe"
However, when I try to connect to the server- I see nothing in the logs indicating an attempt to run the script. I've even tried changing it to a non-existant file to see if that will log an error of some sort, but nothing.
All I get are "Accepted connection" type of logs.
In case it matters- upon start I do get several "unknown option" errors, including "ejabberd_config:validate_opts:752 unknown option 'auth_method' will be likely ignored" - however it seems this is a known, cosmetic-only error (see: https://github.com/processone/ejabberd/issues/630)
I do not use Windows, but, you should try playing with Erlang open_port command:
open_port({spawn, "YOURCOMMAND"}, [{packet, 2}]).
Note that open_port Erlang documentation says:
For external programs, the PATH is searched (or an equivalent method is used to find programs, depending on operating system). This is done by invoking the shell on certain platforms. The first space separated token of the command will be considered as the name of the executable (or driver). This (among other things) makes this option unsuitable for running programs having spaces in file or directory names.
I see your path has spaces. That alone should indeed make it impossible to call your command.
That said, external_auth command has never been tested on Windows. You may need to patch ejabberd command to make that authentication through external process work. I would be surprised if it works as is.
Trying to configure Jenkins CI. Currently just running it from the .war (eventual intention as a service). Jenkins is aware of the CVS executable (i.e. will read the version [Concurrent Versions System (CVSNT) 2.0.62.1817 (client/server)]).
The .cvspass is not specified, because they apparently do not play nice with CVSNT (which prefers to keep passwords in the registry.) I've specified the password in the job config by using the :pserver:user:passg#server:/dir pattern for CVSROOT, which I found suggested in some places. Regardless of whether I run using that, or :pserver:userg#server:/dir as the CVSROOT I get the blinking red ball, jenkins stuck with a nearly full progress bar for 2 and a half minutes. It then fails. The console output yells with something like
FATAL: hudson.scm.ChangeLogSet.iterator()Ljava/util/Iterator;
java.lang.AbstractMethodError: hudson.scm.ChangeLogSet.iterator()Ljava/util/Iterator;
at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:282)
at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:279)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:596)
at hudson.model.Run.run(Run.java:1400)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:175)
Both CVSROOTs I'm using provide no trouble with TortoiseSVN. I've found some mention of difficult of logging into SVN from jenkins as a service and related user/system issues, but considering I'm running it from the .war I don't think that's the issue.
EDIT:
Interestingly the console log if I use an invalid user or password recognizes such.
cvs [checkout aborted]: authorization failed: server rejected access to /dir for user FOO
FATAL: CVS failed. exit code=1
Finished: FAILURE
which indicates that Hudson is talking to the CVS server and authenticating, but something else goes wrong.
/EDIT
Cheers
Answer to the question found, thanks to rpetti on #jenkins on freenode. Problem was I had switched between Hudson and Jenkins and there were some incompatible configuration files that were mucking things up. Deleting and recreating the home directory solved the problem.
CVSNT 2.0.62.1817 is very very old and has several known security issues. Please upgrade to the latest 2.8.01.
I have made a simple Applet which simply invokes a ant target thorugh batch file on click of button. To do this i am using
ExecTask exec = new ExecTask();
exec.setExecutable("run.bat");
Commandline.Argument arg = exec.createArg();
arg.setValue("-buildfile D:/cloudengine/Applet/build.xml");
exec.execute();
When i run this from eclipse it works properly. But my requirement is to run this from a html page so i have created a simple html with applet tag
<APPLET ALIGN="CENTER" CODE="HtmlAntTest.class" WIDTH="800" HEIGHT="500"></APPLET>
But in browser's java console i get below exception on click of button
Exception in thread "AWT-EventQueue-2" java.lang.ExceptionInInitializerError
at org.apache.tools.ant.taskdefs.ExecTask.<init>(ExecTask.java:72)
.
.
.
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission file.encoding read)
Any pointers would be of great help. Thanks in advance
You need to grant additional rights to the applet. It is all explained in detail here:
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html
As das_weezul commented, the applet will require elevated privileges to do this. While changing policy files is one way to achieve that, it is error prone and impractical for deployment.
To get an applet trusted at time of deployment, it will be necessary to:
Put the classes in a Jar file (see Packaging Programs in JAR Files for details).
Digitally sign the Jar file (see Signing and Verifying JAR Files for details).
Get the end user to OK the code when prompted to trust it.
It takes a little time to set up code signing in a build file, but once done correctly it can be forgotten.