i can't fix this 'when safe_mode is enabled" - web-services

This is the error I'm getting for this website.
"Message: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set"

As it says, you need to go into your php config (maybe /etc/php.ini) and
set safe_mode = Off, and
unset open_basedir value.
This is disabling some security, so know what you are doing...

Related

phpseclib 2.0.12 - SFTP login failed but no error

I've installed phpseclib 2.0.12 with composer. I am running PHP 7.0.30.
I cannot log into an SFTP site using:
require($_SERVER["DOCUMENT_ROOT"] . "/vendor/autoload.php");
use phpseclib\Net\SFTP;
define('NET_SFTP_LOGGING', SFTP::LOG_COMPLEX);
$sftp = new SFTP($ftp_server);
echo("<pre>");
if (!$sftp->login($ftp_user_name, $ftp_user_pass)) {
print_r($sftp->getSFTPErrors());
echo $sftp->getSFTPLog();
exit('Login Failed');
} else {
echo("login worked");
}
echo("</pre>");
The output is simply:
Array
(
)
Login Failed
Why is logging not displaying anything at all? How can I see what is failing here?
You should be doing define('NET_SSH2_LOGGING', SSH2::LOG_COMPLEX); and $sftp->getLog(); instead. NET_SFTP_LOGGING only enables logging at the SFTP layer, which is only established after you've successfully authenticated.
Similarily, I'd do print_r($sftp->getErrors()); instead of print_r($sftp->getSFTPErrors());.
In case it helps someone else, I encountered a related issue and the password had a backslash in it. We changed our variable to use single quote marks instead of double and authentication worked. I suspect somewhere it was being treated as escape character. Perhaps this will helps someone save a few hours troubleshooting.

How to get rid of email regex message on Devise?

I'm using Devise Token Auth gem and, everytime I run my test suite in Rails 4.2.5 app, I'm getting this deprecation warning from Devise:
DEPRECATION WARNING: [Devise] config.email_regexp will have a new default on Devise 4.1
To keep the current behavior please set in your config/initializers/devise.rb the following:
Devise.setup do |config|
config.email_regexp = /\A[^#\s]+#([^#\s]+\.)+[^#\W]+\z/
end
If you want to use the new default:
Devise.setup do |config|
config.email_regexp = /\A[^#\s]+#[^#\s]+\z/
end
. (called from block in tsort_each at /usr/local/lib/ruby/2.2.0/tsort.rb:226)
I've already added config/initializers/devise.rb file manually and have set email_regex as suggested by the message above, but the annoying message persists.
How can I disable this message?
Related with this post, you can manage deprecation warnings according to th environment in which you are working, as said in rails guides:
active_support.deprecation_behavior Sets up deprecation reporting for
environments, defaulting to :log for development, :notify for
production and :stderr for test. If a value isn't set for
config.active_support.deprecation then this initializer will prompt
the user to configure this line in the current environment's
config/environments file. Can be set to an array of values.
So just change in config/environments/test.rb the value :stderr for :log
Rails.application.configure do
...
# Print deprecation notices to the stderr.
config.active_support.deprecation = :log
...
end
And with this the depecation warning will be in the log/test.log instead in the console output

Processing rule in DataPower

I Have MQFSH as a backend,but the Queue is not yet created.
As a result the transaction is failing with an error of 2085 "unknown object".
Even after this failure , I can see there is no error rule getting triggered in the probe.
May I know the reason ?
After looking in to various blogs,got to know that
there is a settings under Advaced as " Process Backend Errors".
After setting it "Off" , the error rule started getting triggered.
Thanks & regards,
Sreevathsa A

How to turn on the audit logging with wsadmin script?

I would like to turn on the audit logging with a wsadmin script. I was able to create the audit notification like this:
AdminTask.createAuditNotification('[-notificationName Log_Notification -sendEmail false -emailList -logToSystemOut true ]')
But I can't create the auditnotification monitor, becasuse it needs to have the notificationRef:
AdminTask.createAuditNotificationMonitor('[-monitorName AuditMonitor -notificationRef WSNotification_1428567470299 -enable true ]')
and if I want to get that ref (AdminTask.getAuditNotificationRef()) to put it in a variable, then it needs to have the monitor configured first (according to the IBM documentation). If I do not configure the notification monitor first, then the getAuditNotificationRef will return with null value. But if I want to configure the monitor, I need the notificationRef :(.
Kind of confusing stuff for me...could anyone help me with this issue?
thanks
Have you looked in the knowledgecenter?
http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/txml_7auditnotify.html?lang=en
This shows the following example:
AdminTask.createAuditNotification('-notificationName defaultEmailNotification
-logToSystemOut true -sendEmail true -emailList administrator#mycompany.com(smtp-server.mycompany.com)
-emailFormat HTML')
AdminTask.createAuditNotificationMonitor('-notificationName defaultEmailNotification
-logToSystemOut true -sendEmail true -emailList administrator#mycompany.com(smtp-server.mycompany.com)
-emailFormat HTML')
AdminConfig.save()
As you can see, there is no -notificationRef needed.
Regards,
Gary

magento Not valid template file /page/1column.phtml

I had my site running fine on the devp. server. After I migrated the app to my production server. Everything worked until I added an extension and enabled it. The site still works but the product view page doesn't show up. Everytime I click on the product view page, this error is appended to my log file...
CRIT (2): Not valid template file:frontend/base/default/template/page/1column.phtml
I have checked the file it is alright, just same as the one working on the development server. I've tried disabling the only plugin (custom menu) that I have and still the problem persists. I've tried increasing memory_limit but it doesn't help either.
Please help, I am stuck in the middle of nothing.
A common cause of this error is the use of symlinks without enabling this in the admin area…
System > configuration > developer > Template Settings
The error gets triggered in app\code\core\Mage\Core\Block\Template.php around line 243 ( see here ) - so if its not an issue with symlinks then this would be a good place to start debugging.
If you are not using xDebug then where the exception gets caught around line 250 you should either log or var_dump the values of:
$includeFilePath
and
$this->_viewDir
Then make sure they both exist (paying attention to the case)
Failing that you might want to look at permissions.
UPDATE core_config_data SET value = '1' WHERE path = 'dev/template/allow_symlink';
or
INSERT INTO core_config_data (scope, scope_id, path, value) VALUES ('default', 0, 'dev/template/allow_symlink', '1');