Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [php]

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

0
votes
1answer
20 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
44 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 ...
0
votes
2answers
28 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' => "...
5
votes
1answer
62 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
19 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
17 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
2answers
147 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
22 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
45 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
31 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
36 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
53 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
46 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
32 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
27 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
111 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
21 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
72 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
119 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
107 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
1k 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
63 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
40 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
54 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
96 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
105 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
104 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
28 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
91 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
14 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
147 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
52 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
169 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
132 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
34 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
52 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
39 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 ...
0
votes
2answers
115 views

Using Civicrm_api3 in onAjax[Name] plugin function

I created a plugin which provides custom validation for civicrm forms. Part of the jQuery validation on the plugin makes an AJAX call to the plugin. The plugin calls its onAjax[Name] method. In the ...
1
vote
1answer
36 views

problem upgrading php

I updated to CiviCRM 4.7.28 (on Wordpress). However, I have not been able to update the PHP to the 5.6 version. In fact, after much searching, I don't seem to be able to come up with the correct way ...
0
votes
2answers
79 views

How to catch Fatal error in civicrm?

I'm getting below error message while exporting csv file of 40k record. Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65552 bytes) in /var/www/html/crf-git/modules/...
1
vote
1answer
326 views

Any way to avoid “deprecated function” messages in the Drupal dblog?

I am getting a LOT of entries in the Drupal dblog (watchdog) about a deprecated PHP function, as described here - Debug PseudoConstant I'm trying to debug a different issue and the presence of these ...
0
votes
1answer
46 views

How to echo “Hello World” in civicrm?

I need to echo "hello world" in civicrm how to do this in any page in civicrm? i'm trying to do this using hooks_civicrm_post but there is no result.
1
vote
2answers
34 views

How to extract field from an array returned from an API3 call

I am trying to extract a custom field from a contact record. The API returns an array of the following form: Array ( [0] => 0 [1] => 3 [2] => array ( [0] => array ( ...
1
vote
0answers
140 views

Duplicate Entry UI_External_Identifier MySQL Error

Everytime I try to import a backup of my CiviCRM sql database, I always get an error: #1062 - Duplicate entry '' for key 'UI_external_identifier' in phpmyadmin (4.7.0, PHP version: 7.1.4, mysql 5). I ...
0
votes
1answer
60 views

Debugging SQL - possible database problem

This is possibly a question with much too deep technical aspects (SQL, PHP and Civi-innards...) for this forum, but I don't know where else to start, so here goes. I am experiencing mysterious ...
2
votes
1answer
97 views

“MySQL support not included in PHP”

I have drupal running perfectly; with mysql support. But CiviCRM still giving me this error - “MySQL support not included in PHP.” My PHP version is 5.6.31, as indicated in the screenshot below.
0
votes
1answer
34 views

com_civicrm/civicrm/CRM/Core/BAO/SchemaHandler.php on line 730

Do you have any information about the solution of the error found in the image? Joomla Version: 3.7.4 CiviCRM Version: 4.7.22
2
votes
2answers
211 views

building an extension: how can I create a multiple-step form?

If I just had .php files I would do the following: step1.php's submit button goes to step2.php. step2.php's submit button goes to step3.php, etc. The problem is that I need data that the user entered ...