Skip to main content

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
11 votes
5 answers
664 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?
leeand00's user avatar
  • 331
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 ...
Chris Burgess's user avatar
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. ...
Stephen Palmstrom's user avatar
7 votes
2 answers
457 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&...
Ivan's user avatar
  • 167
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 ...
Christia's user avatar
  • 2,457
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 ...
Richard van Oosterhout's user avatar
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 ...
George Lozier's user avatar
5 votes
3 answers
267 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 ...
raaboyl's user avatar
  • 185
5 votes
2 answers
146 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 ...
ErichBSchulz's user avatar
  • 1,571
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 ...
Pennopoly's user avatar
  • 303
5 votes
1 answer
94 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.
Luke Stewart's user avatar
  • 1,890
5 votes
3 answers
516 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 ...
Elias Sh's user avatar
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 '(' ...
Brylie Christopher Oxley's user avatar
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 ...
Andy Clark's user avatar
  • 4,845
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 ...
Elijah van der Giessen's user avatar
5 votes
5 answers
890 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 ...
William Mortada's user avatar
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 ...
andywozhere's user avatar
5 votes
2 answers
467 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....
ErichBSchulz's user avatar
  • 1,571
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, ...
David Christie's user avatar
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 ...
ErichBSchulz's user avatar
  • 1,571
5 votes
3 answers
297 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 ...
johnnyeng's user avatar
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 ...
eics's user avatar
  • 51
4 votes
2 answers
669 views

Is CiviCRM 4.6.x compatible with PHP 7?

Is CiviCRM 4.6.x compatible with newer version of PHP, 7?
Tapash's user avatar
  • 3,004
4 votes
1 answer
97 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() ...
ErichBSchulz's user avatar
  • 1,571
4 votes
1 answer
399 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 ...
Charlie Wilder's user avatar
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 ...
John's user avatar
  • 1,922
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....
Chris's user avatar
  • 31
3 votes
1 answer
68 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'), ...
deepak's user avatar
  • 197
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 ...
Marian Zastawny's user avatar
3 votes
1 answer
146 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??
ErichBSchulz's user avatar
  • 1,571
3 votes
2 answers
290 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
petednz - fuzion's user avatar
  • 28.4k
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 = ...
themak's user avatar
  • 3,441
3 votes
1 answer
75 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 ...
ErichBSchulz's user avatar
  • 1,571
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 ...
liblogger's user avatar
  • 1,004
3 votes
1 answer
509 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 ...
Frank v D's user avatar
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' =...
huulbaek's user avatar
  • 153
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 ...
Jeremy's user avatar
  • 31
3 votes
1 answer
192 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 ...
Edward Peters's user avatar
3 votes
1 answer
79 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(...
Stephen Chu's user avatar
3 votes
1 answer
166 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 ...
Taiming's user avatar
  • 33
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 ...
TJH43's user avatar
  • 31
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"...
ErichBSchulz's user avatar
  • 1,571
3 votes
3 answers
147 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 ...
Jason Roseweir's user avatar
3 votes
1 answer
211 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 ...
Ivan's user avatar
  • 167
3 votes
2 answers
617 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 ...
ErichBSchulz's user avatar
  • 1,571
3 votes
0 answers
70 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 ...
liblogger's user avatar
  • 1,004
3 votes
2 answers
104 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 ...
Janine's user avatar
  • 31
3 votes
0 answers
808 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 ...
William Mortada's user avatar
2 votes
2 answers
311 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 ...
Pascal Wiesmann's user avatar
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 ...
Agbor's user avatar
  • 35

1
2 3 4 5