I am developing an API using Codeigniter and Phils RESTserver.
It works perfectly fine on my local machine (mac lion) but on my server (Ubuntu 10.04 with PHP 5.3) I get an error.
Severity: Notice
Message: Use of undefined constant CURLOPT_FAILONERROR - assumed 'CURLOPT_FAILONERROR'
Filename: libraries/REST_Controller.php
Line Number: 717
The line in the REST_controller.php file at line 717.
$verify = $CI->curl->simple_get($verify_uri, array(), array(CURLOPT_FAILONERROR => FALSE));
What is wrong? Is there something that I need to upgrade?
change array(CURLOPT_FAILONERROR => FALSE) to array("CURLOPT_FAILONERROR" => FALSE) to get rid of the notice about "Use of undefined constant"
Related
I have a project using the library aauth CodeIgniter. when I run on windows localhost it running as well. when I move my project to the centos server virtualbox I just installed, I found the following error:
A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant PASSWORD_DEFAULT - assumed
'PASSWORD_DEFAULT'
Filename: config/aauth.php
Line Number: 136
any help would be great. Thank you.
I am trying to install opensourcepos from https://github.com/jekkos/opensourcepos
But I am getting this error:
Fatal error: Can't use method return value in write context in D:\Xampp\htdocs\opensourcepos\application\helpers\locale_helper.php on line 67
A PHP Error was encountered
Severity: Compile Error
Message: Can't use method return value in write context
Filename: helpers/locale_helper.php
Line Number: 67
Backtrace:
I followed instructions, this is a brand new install, I'm at a loss...
I'm on WIndows 7, using Localhost with Xampp
The line 67 is question is this one:
if (empty($config->item('thousands_separator')))
When I comment it out, the site loads, but it doesn't work
check readme txt
You are getting following error Message: Can't use method return value in write context saying that you are probably using PHP7 which is not completely supported yet. Check your hosting configuration to verify whether you have a supported PHP version installed
I am trying to connect with PHP to SQL server. I have installed Microsoft ODBC Driver 13 for SQL Server and I have test it using 'isql' command. Now when I am trying to connect to the server in PHP it always crashes and says "http error 500". Here is the code:
<?php
$server = merkur.edikt.local;
$database = ITServiceE;
$connection = odbc_connect("Driver={ODBC DRIVER 13 for SQL Server};
Server=$server;Database=$database;",
'user',
'PW'
);
echo "connected";
?>
I am using Ubuntu 16.04 server and Apache2 and PHP 7.
I think it might be problem with permissions for the Apache(if the Apache can access the ODBC Driver) but I am not really sure how this works.
EDIT:
Here is the log from Apache errors:
PHP Notice: Use of undefined constant merkur - assumed 'merkur' in /var/www/html/index.php on line 2
PHP Notice: Use of undefined constant edikt - assumed 'edikt' in /var/www/html/index.php on line 2
PHP Notice: Use of undefined constant local - assumed 'local' in /var/www/html/index.php on line 2
PHP Notice: Use of undefined constant ITServiceE - assumed 'ITServiceE' in /var/www/html/index.php on line 3
PHP Fatal error: Uncaught Error: Call to undefined function odbc_connect() in /var/www/html/index.php:4\nStack trace:\n#0 {main}\n thrown in /var/www/html/index.php on line 4
and the file odbc.ini is empty and odbcinst.ini looks like this:
[ODBC Driver 13 for SQL Server]
Description=Microsoft ODBC Driver 13 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.0.so.0.0
Threading=1
UsageCount=2
Call to undefined function odbc_connect() means that your PHP system doesn't have any function with that name.
Since it isn't a user function written in pure PHP but a function from a PHP extension, that means that you haven't installed such extension. It's worth noting that the PHP extensions is not the same as the SQL Server driver (you need both).
Your code also contains some undefined constants which I guess are meant to be strings. I strongly recommend you enable full error reporting in your development box so you don't need to check the error logs to learn about simple errors.
im kind of a n00b to Oracle db's, but when i set my dbdriver in codeigniter to oci8, i get the following error, which is weird, providing the extension is enabled in the php.ini file.
I get the following error.
A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS'
Filename: database/DB.php
Line Number: 82
You should install/enable the oci8 extension.
http://www.php.net/manual/en/book.oci8.php
I have installed Codeception following the guide on their website. Everything went okay, so I created my first basic test.
<?php
$I = new WebGuy($scenario);
$I->wantTo('ensure that frontpage works');
$I->amOnPage('/');
$I->see('Homepage');
Trying to execute this and it gave Stack trace errors so I dumped them in result.txt page.
Codeception PHP Testing Framework v1.6.2
Powered by PHPUnit 3.7.19 by Sebastian Bergmann.
Notice: Use of undefined constant CURLOPT_SSL_VERIFYPEER - assumed 'CURLOPT_SSL_VERIFYPEER' in phar://C:/wamp/www/dugun/codecept.phar/src/Codeception/Configuration.php on line 175
Notice: Use of undefined constant CURLOPT_CERTINFO - assumed 'CURLOPT_CERTINFO' in phar://C:/wamp/www/dugun/codecept.phar/src/Codeception/Configuration.php on line 175
Notice: Use of undefined constant CURLOPT_SSL_VERIFYPEER - assumed 'CURLOPT_SSL_VERIFYPEER' in phar://C:/wamp/www/dugun/codecept.phar/src/Codeception/Module/PhpBrowser.php on line 78
Fatal error: Call to undefined function Guzzle\Http\Curl\curl_version() in phar://C:/wamp/www/dugun/codecept.phar/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlVersion.php on line 47
Using WAMP on Windows 7. PHP ver 5.4.3. Apache ver 2.4.2. CURL is enabled in settings. Tried restarting several times, no luck.
Anyone knows how to solve this issue, what may be wrong?
Update
The problem was related to curl.dll. Downloading a fresh one from this topic (PHP cURL not working - WAMP on Windows 7 64 bit) solved the issue.
Based on the errors I'd guess that CURL is missing even though it's enabled, try running a phpinfo() to see if the extension is running.
From the PHP site:
"Note: Note to Win32 Users
In order to enable this module on a Windows environment, libeay32.dll and ssleay32.dll must be present in your PATH. You don't need libcurl.dll from the cURL site."
http://www.php.net/manual/en/curl.installation.php