I have mac, installed PHPstorm 10, now trying to install smarty, similar to as mentioned in following tutorial , http://phpwebscript.blogspot.com/2009/09/smarty-installation-steps-on-wamp-and.html,
i have installed mamp supporting PHP 5.6. everthing is configured file. as mentioned in the tutorial i have edited php.ini file under correct version. After everything is setup i get error on following;
require ('/Applications/MAMP/Smarty/libs/Smarty.class.php');
$smarty =new Smarty() //Undefined class smarty error;
When i run,
echo (defined('SMARTY_DIR') ? 'Yes' : 'No');
i get yes
any fix please.
I have solved this issue, following were the problems that i fixed,
Include path was not set, i though i have included path in php.ini now its ok, but when you create a project in phpstorm or netbeans, there is a folder created external libraries or include path, you have to include smarty, I did it and now everything ok
i had copied testinsall from net which was causing error, retyped it and now smarty is running perfect on phpstorm 10.
Related
I've cloned a Laravel project from Github, then I've run composer install for getting vendor folder. This folder has appeared but I also get weird red lines under each class that show Undefined Type errors. I also deleted the composer.lock and run composer update, but the errors are still there!
Is there any other thing that I should do?
The project was running perfectly, So I found out it was because of my IDE.
The VS Code wanted to validate code using php, and it is not finding php installed.
It's solved by setting php.validate.executablePath in Vs Code setting.
For more information: "Cannot validate the php file. The php program was not found"
Before marking this as a duplicate, hear me out :)
I have some years experience working with PHP on windows, and have even created a portable (for Windows) distribution of an AMP stack: https://thejaka.com/tzwamp/ which I named "WAMP Zero" or TZWAMP. I've used this WAMP distro extensively, and people I know are using it as well. The last (previous) distribution works fine, but when I tried to update the distro to the latest builds of the applications/components from the vendor/distributor sites, I hit a snag. The PHP extensions aren't loading anymore on the new distro. It seems one or more dependencies are not locatable but I don't know what or where from. I tried viewing php_mbstring.dll in a dependency viewer, but couldn't figure out what was the matter. There were a few missing dependencies, but most seemed to be from CRT and I've installed the latest. I'm guessing the missing dependencies can be resolved from PATH environment variable. The following are not loading:
php_mbstring.dll php_mysqli.dll php_openssl.dll php_pdo_mysql.dll
php_mbstring.dll php_mysqli.dll php_openssl.dll php_pdo_mysql.dll
The error messages are like: PHP Warning: PHP Startup: Failed to load ......\php\ext\php_mbstring.dll, The system cannot find the file specified.
Before you start complaining about the relative path, note that on 7.3 it worked fine.
The path to the ext dir is specified relatively, but the path seems to be correct. The same path worked fine in the previous distro of TZWAMP, and when I change the path, the error messages also change leading me to believe the path is correct. Note also that I tried adding php path to PATH environment variable as well.
The successfully working PHP version is 7.3.10.
The problematic PHP version is 7.4.2.
Apache version is 2.4.41
Is anyone aware of any relevant change from 7.3.* to 7.4.*, or else can anyone help me debug the issue and resolve it?
EDIT: I've checked and an absolute path seems to work. However, in order to make this portable, a relative path is required. Relative paths worked with 7.3 and I believe prior major versions. Any ideas?
I've solved this for now to my requirements by using an Environment Variable substitution.
extension_dir = "${P}\php\ext"
However, a relative path solution would also be welcome.
I am just getting start with Zend Framework and seem to run into this problem
Testing Note: PHPUnit was not found in your include_path, therefore no
testing actions will be created.
I am on mac 10.8.5, Using Zend Server 6 (free), and Zend Framework 1.12.3
Have pear and phpunit installed
which pear
/usr/local/zend/bin/pear
which phpunit
/usr/local/zend/bin/phpunit
from php info and include_path
Loaded Configuration File /usr/local/zend/etc/php.ini
include_path=".:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/bin/pear:/usr/local/zend/bin/phpunit:/usr/local/zend/share/pear:/usr/local/zend/share/pear/phpunit"
No matter what i put in the include_path, i always get the above notice, PHPUnit was not found in your include path.
I been searching and someone said zf.ini can cause this, and that file should be editted, however i can't seem to find such a file anywhere on my Mac. I do have previous Mamp and Xampp installations, but phpinfo() states the correct php.ini file loaded so i doubt that is the problem
Edit:
Okay so i finally managed to fix it. Using "zf.sh --setup" i found the paths to all the config files, including .zf.ini and how to edit it. The file did not exist, so i had to create it, and adding "include_path" to .zf.ini fixed the issue. However in the end i am overriding the php.ini which was probably being over ridden. I still like to know why adding pear path to php.ini didn't work, hopefully someone can explain that
I'm trying to install a Magento on my server, and when I get to "Configuration", the installation launches:
PHP extension "curl" must be loaded.
I've checked my php.ini, and extension=php_curl.dll is not commented. For both Apache and PHP folders. I also checked my Wamp manager, and it looks like this:
.
So I guess that my php_curl is working fine... But I still get the same message when I install Magento:
.
Any idea on what's wrong?
I had the same problem. The mod_curl extension in wamp has a bug.
You can replace it with a newer version. I don't know which PHP-Version you use but here you can download a newer version. Download a TS (TheadSafe) version of the module and replace it with your existing curl module.
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
And a helpfull post:
http://forum.wampserver.com/read.php?2,85716
Replaced the old php_curl.dll with the new one in \wamp\bin\php\php5.4.3\ext\ by downloading from http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ .
Now its working. It is the error with recent wamp installation package.
You have to modify the php.ini files in your xampp folder. Three files in three different places need to be changed.
Follow the following steps to enable curl library with XAMPP in Windows:
Step 1:
Browse and open the following 3 files
C:\Program Files\xampp\apache\bin\php.ini
C:\Program Files\xampp\php\php.ini
C:\Program Files\xampp\php\php4\php.ini
Step 2:
Uncomment the following line in your php.ini file by removing the semicolon (;).
;extension=php_curl.dll
After that it will look something like something below-
extension=php_curl.dll
Step 3:
Restart your Apache server.
Step 4:
Check your phpinfo() to see whether curl has properly enabled or not.
Enjoy using curl() library.
My NetBeans have an option to add a path to a script that runs PHPUnit, however when I try to add this script to my NetBeans I get the error that it doesn't recognize the version. Says that version is ?.?.? and that is not supported. However my PHPUnit version is supported by NetBeans and work perfectly when I run it from the pear installer folder (PHP).
"Selected PHPUnit (version ?.?.?) is too old, upgrade it if possible (the minimum version is 3.3.0)" - I got 3.6.4.
My script looks like this
#!/bin/sh
phpunit --bootstrap MyBootstrap.php --stderr $*
And it works great on linux NetBeans. Just not on my Mac.
And yes it works perfect when I run it in the console.
Thanks a milion
/Marcus
I'm not sure what php runner is, but to recognize valid PhpUnit, NetBeans run command "phpunit --version", so check what this command gives you in console.
Once I had problem with this, so I simply found the code of phpunit that is responsible for "phpunit --version" and manually type what should be printed when this command is executed. So NetBeans "saw" correct version and everybody is happy :)
I solved the phpunit problem (too old phpunit message on netbeans)
First open terminal and then:
cd /private/etc
cp php.ini.default php.ini
open php.ini file
change include_path to include_path = ".:/usr/share/pear"
Problem solved :)
If however the problem is not solved then try install netbeans for php from netbeans.org
Mate, that is error by Netbeans (see bug id 188240), and it looks like it is not fixed yet. It happens on Mac OSX.
What i did is to rename Application/NetBeans/NetBeans 7.1.1 to Application/NetBeans/NetBeans7.1.1 (note the lack of space)
as per Xdebug, read this:
http://xdebug.org/find-binary.php
when you get the version for your server, add these lines into your php.ini:
zend_extension = /opt/local/lib/php/extensions/<name of your extension>/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
replacing <name of your extension> with, of course, the name of your extension :)
after this you should be ready to go.
Issue about version soved by reinstalling everything, however I now get this
PHPUnit 3.6.7 by Sebastian Bergmann.
The Xdebug extension is not loaded. No code coverage will be generated.
Cannot open file "/Applications/NetBeans/NetBeans".
How could I load Xdebug? Is that in php.ini or apache conf? or is that in NetBeans?