Questions tagged [php]
PHP is a server-side scripting language designed primarily for web development. CiviCRM is written in PHP.
208
questions
11
votes
5
answers
676
views
Is CiviCRM compatible with Nginx?
If I have PHP installed on nginx, and Wordpress installed too, can I still run CiviCRM as a Wordpress Plugin?
9
votes
1
answer
105
views
What versions of PHP are used in CiviCRM's internal QA?
The wiki currently states that CiviCRM has bare minimum (5.3.10) and recommended (>= 5.4) PHP requirements.
Knowing what CiviCRM has been tested with can help identify what should be expected to work ...
7
votes
2
answers
67
views
Are there up-to-date CiviCRM coding standards available?
I am using NetBeans 8.1 under Windows to develop/debug some CiviCRM code. Previous attempts at getting the contribution accepted ran into trouble as they failed to comply with the coding standards. ...
7
votes
2
answers
471
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&...
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 ...
6
votes
2
answers
276
views
What are the minimum and recommended changes to CiviCRM to support PHP 7?
To pragmatically help CiviCRM step-by-step to support PHP7 I would like to know what the minimum and recommended changes to CiviCRM to support PHP 7?
This will help developers to identify areas of ...
6
votes
1
answer
213
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 ...
5
votes
3
answers
268
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 ...
5
votes
2
answers
147
views
How much symfony do I need to learn if I am going to be a CiviCRM core hacker?
I'm bit of a CiviCRM noob, but I'd like to help out and fit with the current patterns. I keep encountering bits of Symfony in core code and it seems well respected... and pretty cool.
So far I have ...
5
votes
1
answer
10k
views
SOLVED: 'DB Error: extension not found' after PHP upgrade to version 7.0
Civi: 4.7.11
Wordpress 4.7.2
Hi,
I was working on my database today and munged something up. No problem (I thought)... I did a back up beforehand just in case. Unfortunately, after restoring the ...
5
votes
1
answer
96
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.
5
votes
3
answers
517
views
How to speed up CiviCRM 4.7 php execution time
Anyone have an idea of how to speed up CiviCRM PHP execution time ?
I'm an administrator of CiviCRM on Wordpress production set-up, and I find it too slow. I've conducted a little investigation using ...
5
votes
1
answer
3k
views
Unexpected T_CLONE, expecting T_STRING (PHP 7, Drupal 7, Ubuntu 16.04)
On an Ubuntu 16.04 VM with PHP 7.x, I am seeing the following error when enabling CiviCRM in Drupal 7:
ParseError: syntax error, unexpected 'clone' (T_CLONE), expecting identifier (T_STRING) or '(' ...
5
votes
2
answers
665
views
What is the recommended level of PHP for CiviCRM? There seems to be some inconsistencies
See the wiki which says the minimum level is 5.4+
But see this linked page from the wiki which recommends 5.6 with a bare minimum of 5.3.10.
See also the system status for release 4.7 which says ...
5
votes
3
answers
769
views
Unable to install extensions: HTTP redirection error
I'm unable to install CiviCRM extensions from CiviCRM » Administer CiviCRM. On the CiviCRM extensions page I get the following error:
WARNING: The downloader may be unable to download files which ...
5
votes
5
answers
910
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 ...
5
votes
1
answer
110
views
Recommended version of PHP?
What PHP version would you recommend for running CiviCRM version 4.6.8?
I was using an old version of PHP (4.3.3), but that is no longer sufficient to run CiviCRM and 5.4+ is recommended in the ...
5
votes
2
answers
470
views
Class naming and namespaces: best practice as an extension author?
Noting these related questions
(1
2
3)
and these two wiki pages
(1
2)
and the psr-0 standard, I remain a bit lost about current best practice in CiviCRM extensions!
So if I have an extenstion org....
5
votes
1
answer
315
views
How do I correct mismatched Timestamps for MySQL and PHP without access to server?
I'm using civiCRM 4.6.2 under Wordpress.
The PHP and MySQL timezone settings are reported as incompatible, MySQL as 12:38 (which is the current clock time here in Zurich) and PHP as 10:38. However, ...
5
votes
3
answers
22k
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 ...
5
votes
3
answers
301
views
Add custom field and populated with array/data from a non-civicrm table
newby here with a quick question about custom fields.
Is it possible to set up a custom field that queries a non-civicrm table?
Hoping to create an autocomplete dropdown menu that does a SELECT on a ...
5
votes
0
answers
54
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 ...
4
votes
2
answers
671
views
Is CiviCRM 4.6.x compatible with PHP 7?
Is CiviCRM 4.6.x compatible with newer version of PHP, 7?
4
votes
1
answer
101
views
How to let extension users choose cache system?
CiviCRM contains some useful caching infrastructure (confluence wiki and related question).
If I am creating a module and I would like to allow users to override the default Civi::cache() ...
4
votes
1
answer
400
views
Uncaught CRM Core_Exception Transaction/Manager.php
Joomla 3.4.3
CiviCRM 4.6.4
Apache/2.4.12 (Unix)
5.5.43-MariaDB
PHP 5.4.41
Attempt to quickedit existing entry and get "Network Error -- Unable to reach the server. Please refresh this page in your ...
4
votes
2
answers
44
views
Why does the mailer processQueue method 'shuffle' the array of possible locks?
https://github.com/civicrm/civicrm-core/blob/a2976e7c0c2515379e98ee9b5ebcf51acde4e540/CRM/Mailing/BAO/Mailing.php#L2867
$lockArray = range(1, $mailerJobsMax);
shuffle($lockArray);
// check if ...
3
votes
3
answers
172
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....
3
votes
1
answer
71
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'),
...
3
votes
1
answer
558
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
150
views
What are `*.mgd.php` files for?
Browsing through a civix generated file I see it globbing for *.mgd.php files?
What are these files all about then??
3
votes
2
answers
292
views
How to add custom templates (tpls) or php files
What is the 'civi' approach to customising templates and php files? (if this question is a duplicate very happy to remove. I just searched for one after reading Error Message Customization
3
votes
1
answer
287
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 = ...
3
votes
1
answer
76
views
Smarty and future proof code
I am trying to be a more conforming civicrm coder.
Smarty used by civicrm for pages (and forms?)
I have never used Smarty.. Is it going to be part of civicrm going forward? And are there any tips ...
3
votes
1
answer
84
views
Fatal error on CiviEvent dashboard in 4.7 using PHP 5.3.5
Just tried the 4.7 upgrade and found it was giving a fatal error when I tried to acces either the event dashboard ( /civicrm/event?reset=1 ) and Manage Events ( /civicrm/event/manage?reset=1 ).
Fatal ...
3
votes
1
answer
513
views
Message: "CiviCRM does not have permission to write temp files" after login into back-end Joomla
My host updated PHP to 5.5. last night. Now, I can't login to my Joomla back-end because of an error. It says that CiviCRM does not have permission to write temp files.
What can I do to make sure ...
3
votes
1
answer
93
views
Why does PHP Contribution API not filter on contact_id in 4.6.2?
We recentely upgrade from 4.5.x to 4.6.2 and after that the following API call from PHP does not filter on contact_id and return all contributions for all contacts.
$params = array(
'contact_id' =...
3
votes
1
answer
26
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 ...
3
votes
1
answer
200
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 ...
3
votes
1
answer
82
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(...
3
votes
1
answer
169
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 ...
3
votes
1
answer
155
views
Need help upgrading 4.4.5 to 4.7.18 0n Ubuntu 16.04 server with PHP 7 on Drupal 7
The VPS host running Drupal/CiviCRM was upgraded from Ubuntu 14 LTS to 16 LTS. That ran without error. However, that upgrade came with PHP7. immediately after the upgrade all three CiviCRM sites ...
3
votes
1
answer
50
views
What are the core functions an extension can rely on?
It's been said, quite reasonably, that all APIs should have tests, and that if a feature doesn't have tests then coders shouldn't rely on it.
This raises two three questions:
other than direct "API3"...
3
votes
3
answers
150
views
civix civicrm:ping not printing any output
I am running CiviCRM on Mac OSX 10.11.3, using the latest Bitnami CiviCRM/Drupal stack (bitnami-civicrm-4.6.11-0-osx-x86_64).
I have civix-15.04.1 installed as instructed (under $HOME/civix), and ...
3
votes
1
answer
212
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 ...
3
votes
2
answers
624
views
Where is the exact path to the ConfigAndLog log *file*?
In the latest awesome pattern we can now locate our log service easily:
Civi::log()->info('Hello, log!');
And then we can tail the log which is in our ConfigAndLog directory. Chris has enumerated ...
3
votes
0
answers
73
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 ...
3
votes
2
answers
106
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
0
answers
814
views
Does the 'timestamp mismatch' error cause any real problems?
I am getting the following error when I log in to CiviCRM:
Timestamps reported by MySQL (eg "2015-11-06 13:44") and PHP (eg
"2015-11-06 11:44" ) are mismatched.
I have reported this separately ...
2
votes
2
answers
312
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 ...
2
votes
2
answers
96
views
Buildkit Site fails to load due to PHP ugrade from 5 to 7
After Upgrading from php 5.6 to php 7, when i try to access the sites created using buildkit, I am unable to access it.
After typing
Civibuild show dmaster
I get the following
ERROR: Failed to find ...