Questions tagged [php]
PHP is a server-side scripting language designed primarily for web development. CiviCRM is written in PHP.
196
questions
0
votes
1
answer
41
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
52
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
72
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
105
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:
...
1
vote
2
answers
91
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 ...
3
votes
0
answers
53
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
100
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/...
5
votes
3
answers
259
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
1
answer
34
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
51
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
158
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 ...
7
votes
2
answers
401
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
1
answer
255
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
239
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
55
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
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
29
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....
1
vote
2
answers
76
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
1
answer
61
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
92
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
81
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
144
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
2
votes
1
answer
44
views
Redirect to dashboard instead of redirect to add form
I've installed wordpress Version 4.9.8 with civiCRM.
Now i have create one new menu name is "userdata"
But when i click on menu "Userdata" it will redirect to the dashboard. Instead of dashboard it ...
1
vote
2
answers
73
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
34
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(...
3
votes
1
answer
556
views
timestamp mismatch
I have a host running in a different time-zone from where I am operation and unless I set the website time zone to the hosting time zone I get the following error in CiviCRM:
Timestamps reported by ...
3
votes
1
answer
285
views
Error with CiviVolunteer after upgrading to PHP 7.1
Via permissions page and system status page.
Warning: Declaration of CRM_Volunteer_Permission::check($permissions) should be compatible with CRM_Core_Permission::check($permissions, $contactId = ...
0
votes
1
answer
42
views
Custom PHP not being picked up
I've been pulling my hair out trying to get this working. There is a file in core that throws up errors using the SagePay extension from Circle. I can edit the core .php file and fix the problem. ...
3
votes
1
answer
201
views
How to change the value of a custom radio button field programmatically?
I have a CiviCRM profile that hosts a custom field. The custom field is of type "Radio-Button" and hosts two options:
What I'm trying to achieve is changing the values of each option programmatically ...
2
votes
1
answer
193
views
Issue with MySQL support
Attempting to install CiviCRM 4.6.38 in Wordpress 4.9.8, PHP 7.2.5, MariaDB 10.3.8, Nginx 1.14.0, Amazon Linux 2. Getting "MySQL support not included in PHP". PHPinfo shows mysqli and mysqlnd enabled.
0
votes
1
answer
36
views
How can I add PHP as content with HTML editor?
Using Drupal 7 with CIVI crm 5.x
I'm doing some testing with this:
Hello World'; ?>
Paste it in source code, but then it strips it out like this:
<!--?php echo '<p-->
<p>Hello ...
2
votes
2
answers
814
views
Fatal error: Call to undefined function ctype_space()
Has anybody else seen this fatal error after upgrading to CiviCRM 5.3.2? It appears when trying to manage groups or create a new group in "Contacts" and I don't think we had this under 5.3.0.
The ...
2
votes
2
answers
465
views
How to reset CiviCRM?
When writing a re-initialisation script / extension or drupal module, how would you reset CiviCRM back to clean installation state? Is it possible to install "minimal" without components and their ...
6
votes
3
answers
8k
views
What to do with "mcrypt" message after upgrading to PHP 7.2
What should I do about the following message in my CiviCRM status page, after upgrading to CiviCRM 5.3.0, PHP 7.2 from 5.6, and also upgrading my OS from Debian 8 to Debian 9:
PHP Missing Extension ...
2
votes
2
answers
317
views
How to use CiviCRM REST API in external PHP code
Been trying to get this to work for hours. Help would be greatly appreciated. userkey and sitekey are replaced with actual keys.
I'm trying to run in a php file:
$result = curl -X POST "https://www....
2
votes
1
answer
64
views
PHP Fatal Error on Custom Report
Background
We have had Civicrm running for two years. last week a malicious attack occurred. We had to implement a back up copy taken of our crm on 12th June 2018. All is working except for a custom ...
3
votes
3
answers
171
views
Cron breaks after upgrading PHP
I'm running CiviCRM 4.5.5, Having recently upgraded to WordPress 4.9.5 and PHP 5.6 (mailing was flawless just prior to this). Latest scheduled mailing failed to initiate, and a URL method test of cron....
5
votes
3
answers
21k
views
how do I use phpcbf?
When I run civilint in the build kit I get a long report which ends with this line:
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
Well that sounds great! Where is this mythical phpcbf ...
1
vote
2
answers
123
views
How are CiviCRM form names defined (civicrm_validateForm)?
I am attempting to perform form validation on various CiviCRM forms (profile forms and forms within contribution pages) by hooking into hook_civicrm_validateForm.
In my php code, I would like to ...
2
votes
1
answer
125
views
Using CiviCRM API in Drupal View
I am trying to use the Civi API within a Drupal view, in the global PHP field.
It is all working, except for when I try to use an "Available Variable" from the view, it throws and error. When I hard ...
1
vote
1
answer
350
views
CiviCRM running very slow on local network
CiviCRM running very slow on local network, but index.php ,phpmyadmin and joomla are fine. What could be the problem? I tried this solution (https://processwire.com/talk/topic/8320-local-dev-server-...
1
vote
1
answer
184
views
SQL Syntax Error - When starting civicrm with joomla
Please help, i have no idea what is wrong, all is fine until i open civicrm with joomla, it displays sql syntax error, then when I try to look at my db functions with phpmyadmin there will be a whole ...
1
vote
1
answer
61
views
How to get CiviCRM root via PHP?
I'm working on an extension and I need to include a PHP file that is in the civicrm module root dir. Is there a way to get this directory through PHP? I need it to work for all CMS, not just Drupal.
...
2
votes
2
answers
80
views
When exporting contacts using custom selected fields, results in "Undefined Index ...Mapping.php Line 622"
When trying to export a list of Contacts selecting a previously defined set of Export Fields, system throws this error:"Notice: Undefined index: in /home/.../Core/BAO/Mapping.php on line 622"
When ...
1
vote
1
answer
154
views
Fix for "Incorrect Resource URL" message
In my Wordpress installation of CiviCRM I have had a persisting System Status:Error message since version 4.7.28 which was still present despite upgrade to 4.7.31. This appeared to be a false-...
2
votes
2
answers
207
views
Mailing stopped working after CiviCRM, PHP and Drupal upgrade
Recently I upgraded:
Drupal core to 7.57
PHP from 5.6 to 7.0.28-1
CiviCRM from 4.7.27 to 4.7.31
Since I've done so I can't send mailings.
Basically I get the same thing like in the post described ...
1
vote
0
answers
23
views
Formatting search queries from Civi
Can anyone tell me where I can find the php or css that affects how search profiles are formatted? I want to alter how it looks on the webpage because it clashes with the flow of the website. Any ...
0
votes
2
answers
102
views
Adding and storing form fields
I figured out how to add form fields using the buildForm hook. I am adding a select element to a participant profile on an event registration form. Do the values from the added fields get saved when ...
5
votes
5
answers
858
views
Timestamp mismatch between MySQL and PHP
Every time I log in to CiviCRM I get the following error message:
Timestamps reported by MySQL (eg "2015-11-06 13:44") and PHP (eg "2015-11-06 11:44" ) are mismatched.
I am using CiviCRM 4.6.10 ...