hnw / php-timecop

A PHP extension providing "time travel" capabilities inspired by ruby timecop gem
MIT License
385 stars 40 forks source link

Issue with Homebrew php70-timecop #40

Open RopoMen opened 6 years ago

RopoMen commented 6 years ago

Hi,

I have been able to install php70-timecop sometime ago, but currently it is giving error.

brew install homebrew/php/php70-timecop        

Updating Homebrew...
Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.
JoeHopping commented 4 years ago

Hi,

Was this issue ever figured out? I'm having the same issue.

loilo commented 4 years ago

The whole PHP/Homebrew story changed a while ago. Extensions are no longer available via Homebrew but should be installed via PECL:

pecl install timecop-1.2.10

Afterwards I had to adjust my php.ini because the extension was automatically inserted there, but with an incorrect path.

The correct path to the timecop.so should be printed at the end of the above PECL install command. Mine looked like this:

[...]

Build process completed successfully
Installing '/usr/local/Cellar/php@7.2/7.2.22_1/pecl/20170718/timecop.so'
install ok: channel://pecl.php.net/timecop-1.2.10
Extension timecop enabled in php.ini

So I had to open my php.ini and replace

extension="timecop.so"

with

extension="/usr/local/Cellar/php@7.2/7.2.22_1/pecl/20170718/timecop.so"

Hope this helps.

metaxenology commented 8 months ago

@loilo Tried with above on MacOS with M1 chip but it fails, with the following error:


/private/tmp/pear/temp/timecop/php_timecop.h:183:32: note: expanded from macro 'call_php_method_with_0_params'
        _call_php_method_with_0_params(obj, ce, method_name, retval TSRMLS_CC)
                                      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [timecop_php7.lo] Error 1
ERROR: `make' failed```