Questions tagged [php]
PHP is a server-side scripting language designed primarily for web development. CiviCRM is written in PHP.
196
questions
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 ...
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
2
answers
81
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
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
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....
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
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
2
answers
101
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
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
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(...
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 ...
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 ...
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 ...
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 ...
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....
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.
...
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-...
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 ...
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 ...
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 ...
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 ...
0
votes
1
answer
201
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
0
answers
53
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
1
answer
84
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
2
answers
75
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
2
answers
242
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
1
answer
44
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
2
answers
175
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
1
answer
1k
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
1
answer
60
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
2
answers
83
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 (
...