We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [php]

PHP is a server-side scripting language designed primarily for web development. CiviCRM is written in PHP.

Filter by
Sorted by
Tagged with
2
votes
1answer
18 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
1answer
29 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
0answers
23 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
1answer
36 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
1answer
30 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
2answers
59 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
1answer
21 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
0answers
22 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 ...
1
vote
1answer
57 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
1answer
33 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
1answer
44 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
1answer
30 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
2answers
74 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
2answers
38 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' => "...
6
votes
2answers
119 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
0answers
20 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
0answers
20 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....
4
votes
3answers
199 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
2answers
39 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 ...
2
votes
2answers
52 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
1answer
40 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
1answer
54 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
1answer
61 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
0answers
76 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
2answers
50 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
1answer
21 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(...
2
votes
1answer
32 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 ...
2
votes
1answer
165 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
1answer
22 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
1answer
103 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
1answer
156 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
1answer
27 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
2answers
168 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 ...
6
votes
3answers
2k 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 ...
1
vote
2answers
131 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
1answer
42 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 ...
1
vote
2answers
60 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 ...
3
votes
3answers
121 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....
1
vote
1answer
143 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
1answer
121 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
1answer
35 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. ...
1
vote
1answer
123 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-...
1
vote
0answers
17 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 ...
2
votes
2answers
164 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 ...
0
votes
2answers
67 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 ...
3
votes
1answer
255 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 ...
0
votes
1answer
161 views

PHP version matters or not?

I've been running certain 5.6 for a long while and wondering if I ever should migrate to 7.0 or just leave alone. Installation instructions say 7.0 is recommended but so is 5.6 Anyone have opinions ...
1
vote
0answers
40 views

Migrate Jooomla installation to new server

Having a terrible time when changing server and updating Joomla and Civicrm. Apologize for the length of this post, but thought is would be helpful to anyone who can address my issues. Here's the ...
0
votes
1answer
55 views

Very slow mailing job with Mosaico with Imagick and UrlFilter.php errors

I have a problem where my mailing is being sent crazy slow, like hundred emails an hour. At the same time my cpu utilization is of the charts where apache2 is using like 99% of the cpu. In the php ...
0
votes
2answers
52 views

condition on count from chained api call

I am trying to use the api to get all contacts without an address with locationtype billing. For this I use the contact get api, and do a chained address get call. Is there a way to put a condition on ...