Questions tagged [php]
PHP is a server-side scripting language designed primarily for web development. CiviCRM is written in PHP.
176
questions
0
votes
1
answer
23
views
How to hide these 'deprecated' type messages when implementing PHP 7.4?
Having just upgraded a site to 5.47.2 and noting that PHP 7.4 is recommended I rashly took this seriously :) and ended up with 3 messages that splat themselves over the top of the majority of screensm ...
0
votes
0
answers
18
views
"Current and Upcoming Events" is missing and trying to ICalendar.tpl.php file that does not exist
Ive been thrust into trying to help a buddy fix his civicrm deployment and I cannot find a way to generate this template necessary to populate that page.
Looking at the errors it is looking for the ...
1
vote
1
answer
20
views
Is there any way to apply two "NOT Like" conditions in Civicrm API?
Hi I am using Civicrm api v3. I am trying NOT Like condition with single condition it is working. But i need to apply two conditions with string1 and string2.
$contribution = civicrm_api3('...
0
votes
0
answers
14
views
Why does W3 Total Cache serve cached pages to logged in users (Wordpress)?
I'm using a contribution shortcode in a Wordpress page. I need the HTML/XML request to never load from cache for both logged-in and anonymous users.
In W3 Total Cache, I have the "Don't cache ...
1
vote
1
answer
34
views
CiviCRM WordPress Upgrade to 5.44.0 Error
When upgrading I get this error:
Fatal error: Cannot redeclare Matrix\adjoint() (previously declared in /home/xxxxxxxx/public_html/wp-content/plugins/civicrm/civicrm/vendor/markbaker/matrix/classes/...
0
votes
0
answers
15
views
How should I configure default time zones for Wordpress, CiviCRM, PHP, and MySQL?
Wordpress's time zone is set to "New York", PHP is set to "UTF", and MySQL is set to a UK time zone. Is the proper configuration to set each of these to "New York", or ...
1
vote
1
answer
26
views
Map firstname-lastname pairs to IDs
I have a long list of donations that I want to import. My first step was to ensure that all the contacts in the list exist in CiviCRM - that's done, and I spent a while deduplicating the records. ...
0
votes
1
answer
24
views
Error when importing contacts - "Warning: Illegal string offset 'code'"
After importing a CSV of contacts, I'm getting a blank screen with the error message below. Typically, I get a report of how many contacts were skipped due to duplicates. It appears the data is ...
1
vote
2
answers
34
views
CRM Core Exception Could not find valid session key form error
I know there are lots of threads on this with no clear solution. Posting again for any new input. Using cicivCRM 5.39.0.
0
votes
1
answer
34
views
Select2 in php forms?
I have a simple quickform --
$this->add('text','trial_number','Trial Number',TRUE);
$this->add('date','Trial_Date',ts('Trial Date'),CRM_Core_SelectValues::date(NULL, 'Y M d',15,1) );
...
1
vote
0
answers
64
views
Contributions in WordPress causing fatal errors
WordPress v5.6.1
CiviCRM 5.34.0
php 7.3
No custom extensions that affect contributions except CiviDiscount.
When I try to add a new contribution or view contributions, I get an error and the log ...
1
vote
1
answer
131
views
An active PHP session was detected
I'm running CiviCRM v5.32.2 and the CiviCRM WP REST API v0.1 plugin in Wordpress v5.6.
In Wordpress Site Health Status i get this warning:
An active PHP session was detected
A PHP session was created ...
0
votes
1
answer
49
views
utfmb4 conversion gone wrong - Some columns in the databse have utf8mb4_general_ci others utf8mb4_unicode_ci causing and Illegal mix of collations
I've recently run utf8mb conversion (through API explorer) on civi 5.28. Everything seemed OK, but now whenever I try to access events dashboard I get Illegal mix of collations (utf8mb4_general_ci,...
2
votes
1
answer
58
views
DB error for sort_name when adding contacts with long names in 2 bytes UTF8 characters
The problem occurs when I try to add a contact (in the example it's an organization) with long name in Cyrillic (multiple words in it's name). I get the nativecode=1406 ** Data too long for column '...
3
votes
1
answer
19
views
membershipTypeValues hook not updating membership price
On my civicrm contribution page I have a field that I want to use to calculate the membership price.
Currently Im trying to use the membershipTypeValues hook to edit the price after the contribution ...
1
vote
0
answers
39
views
moving DB to a new server - PHP errors
I have been attempting to move a civi install to a new site with little success. I know I have managed this before with another site, so I am especially mystified.
I have reviewed the the guide at ...
1
vote
2
answers
98
views
Help to renew membership using the API
I would like to programatically renew memberships when a transaction has been completed in Woocommerce.
I want my members to have a more consistent experience and since I do a lot through the ...
1
vote
1
answer
47
views
Removing "List-Unsubscribe" from civimail headers (for when getting seemingly random unsubscribes)
There is a "header" entry automatically put into mailnigs from civimail (also when using flexmailer / mosaico) which some email clients use to enable unsubscribing (or opting out) from mailing lists.
...
0
votes
1
answer
97
views
Getting "set_time_limit() has been disabled for security reasons" when importing a CSV file into contacts
I'm getting "set_time_limit() has been disabled for security reasons" when importing a CSV file into my contacts.
The exact warning is "set_time_limit() has been disabled for security reasons in /...
3
votes
1
answer
143
views
Exhausted memory error
I am getting reports from users of blank screens when going to register for an event. This does not happen for most users.
The PHP error log says:
PHP Fatal error: Allowed memory size of 536870912 ...
6
votes
1
answer
191
views
packages/Net/UserAgent/Detect/APC.php flagged as malicious by Wordfence Firewall
Our Wordpress firewall Wordfence has flagged packages/Net/UserAgent/Detect/APC.php as possibly a malicious file. Based on past experience, I assume this is a false positive. However, I posted it ...
1
vote
0
answers
55
views
"You do not have permission to access this content" error after inputting data into an HTML form
I am working with an arts organization in my town and they recently migrated their civiCRM application (which is serving as a plugin to their wordpress website) from GoDaddy to InMotion. We are ...
0
votes
1
answer
39
views
New Extension Tab Zip Support Required Message
After upgrading to PHP 7.2, now receiving this message when trying to add a new Extension
ZIP Support Required
You will not be able to install extensions at this time because your installation of PHP ...
5
votes
0
answers
49
views
Setting note privacy to groups instead of just author [duplicate]
[On Civicrm 5.19.1, Drupal 7]
Is it possible within Civicrm to make a new privacy setting that limits viewing notes to an entire group, and not only the author?
We would like all tarification people ...
3
votes
1
answer
43
views
How to set read only field in Drupal CiviCRM
I would like to set a read only field in Drupal CiviCRM:
mymodule_civicrm_buildForm($formName, &$form) {
...
// Set default value
$defaults['readonly_field'] = xxx;
$form->setDefaults(...
1
vote
1
answer
83
views
Override CiviCRM contact import timeout using PHP-fpm and Nginx
I'm attempting to override the fpm time out from nginx just for the import. We are importing very large files, and it might take up to a couple hours to complete, so I need to set:
...
3
votes
0
answers
41
views
Update sequence for verrry old versions of CiviCRM, Wordpress and PHP
I'm tasked with updating an old installation of CiviCRM for another org - they have CiviCRM 4.6.3 and WordPress 4.5.18 running on a shared server that's on PHP 5.4.
I don't yet know if it'll be ...
2
votes
1
answer
90
views
Only configuration works — Fatal memory error on Drupal8 install
I'm trying to set up civicrm on a working drupal8 install and after the composer commands and a few of the suggested tweaks (like path setting), it seems to work ok. I can access the backend ...
2
votes
1
answer
62
views
CiviCRM on Debian 10 gives warning about PHP MySQL Driver (libmysqlclient)
Recently moved my CiviCRM install to a server running Debain 10 which brings:
php7.3
MariaDB 10.3.17
Everything seems to be working fine, except that in the system checks I'm now seeing this error/...
1
vote
2
answers
89
views
Civi 5.x not recognizing PHP 7.1 in Drush
This is the second site I've noticed this on - in both cases, the site is running PHP 7.1.32, as reported on the Drupal system status page.
Error message:
CiviCRM requires PHP 7.0.0+. The web ...
1
vote
1
answer
31
views
Is Civicrm 4.7.20 compatible with PHP 7.? - only using core components and one extension, cividiscount
I set up our website using Civicrm 4.7.20, MySQL 5.0.11, PHP 5.6 and Apache 2.4 some time ago; I will update (soon ISA) but want to know whether I can activate php 7 now?
1
vote
0
answers
42
views
phpseclib version
I'm attempting to add CiviCRM to a site based upon the Open Social Drupal distribution. I'm hitting a brick wall due to a versioning conflict - not with the two systems directly, but to the support ...
3
votes
1
answer
135
views
SSL-encypted Database connection for CiviCRM?
I am in the middle of deploying a CiviCRM instance and have decided for scalability and security reasons to separate my web server and database server. I have a set of self-signed certificates ...
1
vote
1
answer
156
views
Attachment API File Upload
I'm working on a file upload of an image with a registration form. The file is being passed to PHP correctly, and I can check its properties in the $_FILES variable. I used the API Explorer to get the ...
0
votes
1
answer
172
views
Unable to hide PHP 'notice' warning
We are moving our CiviCRM site over from Drupal to Wordpress. We have this fully working on our developer's server (nginx), but on our live server (Apache), we see an error when loading some CiviCRM ...
0
votes
1
answer
46
views
How to get a data for a perticular logged in user ( through API)?
I gave an ACL role to users for data segregation. I want to fetch data from database but data must filter i.e. ACL. How to get data. Also I want a userkey and sitekey?
1
vote
2
answers
99
views
Broken SMTP after switching to PHP 7.2
Recently I updated CiviCRM to version 5.10.4 and while I was at it updated Drupal to 7.64 (using drush). Everything appeared fine. Then I noticed in the CiviCRM System Status report that PHP 7.1 which ...
1
vote
2
answers
67
views
API problem regarding to Word Replacement
I want to replace a word. I was trying to insert using API3 but it is not working properly.
Word replacement API3
$result = civicrm_api3('WordReplacement', 'create', [
'find_word' => "...
7
votes
2
answers
299
views
Get URL of custom image field
I would like to display pictures which are defined as custom "File" fields within an event. I currently to this by generating URLs having the following format:
MY_URL?q=civicrm/file&reset=1&...
1
vote
0
answers
27
views
How to use symfony and doctrine 2 framework for building an extension?
I created an extension using core php and CiviCRM tool(civix). I want to use a symfony(framework) and doctrine(ORM). Beacuse ORM provide some methods to store and retrieve methods are there. Symfony ...
1
vote
0
answers
25
views
Assigning a php associative array to JS?
I am trying to assign a php array to js.
// On the Server:
CRM_Core_Resources::singleton()->addVars('myNamespace', array('foo' => 'bar'));
// In the JS file or inline script
CRM.alert(CRM....
5
votes
3
answers
250
views
Upgraded to PHP 7.2; no errors but Sparkpost doesn't receive and send CiviMail
I upgraded to PHP 7.2 and received the system warning stating "your SMTP password will not be stored encrypted, and if you have recently upgraded from a PHP that stored it with encryption, it will ...
1
vote
2
answers
62
views
getting this error: PDOException: SQLSTATE[23000]
After installation I am getting this error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'civicrm_handler_field_custom_file-class' for key 'PRIMARY': INSERT ...
3
votes
2
answers
86
views
I get a WSOD when I use the search function on CiviCRM
CiviCRM was working fine until I downloaded an extension called CiviRules. I looked into the API for field UFMatch, clicked around in there, and pressed execute (got no warning that it was going to ...
3
votes
1
answer
51
views
How to set a id attribute to button?
I am creating a button using php pear.
Button (php code)
$this->addButtons(array(
/**
* Array for 'next' button
*/
array(
'type' => 'next',
'name' => E::ts('Next'),
...
5
votes
1
answer
87
views
Why do click and open reports show times in UTC rather than the site's timezone?
The mailing and click tracking reports are showing times in UTC. There is no PHP MySQL timezone mismatch - and mysql -e 'select now()' and date return the right times - as per timezone.
2
votes
1
answer
77
views
Upgrading a server that's hosting CiviCRM to get to PHP 7
I did the deed and upgraded from Debian 8 to 9 and from PHP 5.6 to PHP 7.0. I wanted 7.1 but the host recommended I stick with the native packages since the 7.1 broke the SOAP function. I've been ...
1
vote
0
answers
134
views
PHP Missing Extension "mcrypt" in Joomla
In my panel civicrm display mistake: "PHP Missing Extension "mcrypt". I am add screen with this post. In screen show this mistake.
Pleas help me to fix this bug.
PHP Missing Extension mcrypt joomla
1
vote
2
answers
72
views
Upgraded php from 5.6.30 to 7.0.32, civicrm still gives PHP out of date error
I upgraded php from 5.6.30-0+deb8u1 to 7.0.32-1~dotdeb+8.1 and civicrm is still giving me a php out of date error.
When I run php -v it says 7.0, but civicrm still thinks I'm on 5.6.
Do I need ...
1
vote
1
answer
29
views
Upgrading Custom Extension for PHP 7: How to I instantiate a mysqli data object
I've just upgraded a site from CiviCRM 4.6.38 LTS to CiviCRM 5.7 because we upgraded the server to PHP 7.1.x. As a result 2, custom extensions are warning me because they used mysql_real_escape_string(...