Normalizer not found in PHP 5.3.8 and NOT xampp - php

The only help i can find is about XAMPP installations, but i'm running a fresh root server with Plesk and.. classical LAMP and PHP 5.3.8 - everyone is telling me that Normalizer class must be available in PHP 5.3+, but it's obviously not available in my server..
what is missing, what i have to do that the class is there and running?

Unless PHP was compiled with the --enable-intl flag, the Normalizer will not be available. Check using phpinfo(). If it's not enabled, you can either recompile PHP, adding that flag, or try the PECL installation.
See http://php.net/manual/en/intl.installation.php
If the PHP installation was provided by the OS, perhaps you can use its package manager to add the intl extension as well. With root privileges, just run something like this:
$ apt-get install php5-intl

Related

Configuring PHP for pthreads

I am trying to install pthreads for PHP, which is here.
In PHP manual of extention it says:
To enable pthreads support, configure PHP with --enable-maintainer-zts
and --enable-pthreads.
I have a CentOS server which has PHP installed but I cant figure out how to reconfigure it with these settings on, I checked my phpinfo() can see current ./configure options.
I will happy if someone can show me how to reconfigure my php. Do I need to uninstall current PHP first then install another or is there any way to run this ./configure command easily. I have SSH access to my server.
You could try install using PECL:
http://pecl.php.net/package/pthreads.
How to install PECL extensions:
http://php.net/manual/en/install.pecl.php
pecl install pthreads
I've written a tutorial about exactly this - Compile PHP with pthreads and ZTS enabled.
You must compile PHP as there are no prebuilt packages.
To reconfigure everything you'd use ./configure mainly.
if centos does not provide a thread safe version, you must compile php by own.
You have to build pthreads for your centos op system. After that you can use it as extension...
Use the following tutorials
http://blog.slowbro.org/2013/08/compiling-php-55-with-pthreads-on-centos/
http://eddmann.com/posts/compiling-php-5-5-with-zts-and-pthreads-support/
Or simply read the manual...
http://www.php.net/manual/en/pthreads.installation.php

How to use Pthreads PHP extension in Ubuntu

I have problems with the Pthreads PHP extension. I have compiled PHP with ZTS enabled (--enable-maintainer-zts) and installed the pthreads via pecl and also tried to manually compile the extension.
It seems I don't actually know how to use it. I assumed I would be able to use the Thread class in PHP like any other built-in class, but with no luck as PHP doesn't recognize it. POSIX functions seem to work.
I am using Ubuntu 12.10 Server 64-bit with mod_php 5.4.6.
If you cannot access the extensions classes then it is not loaded.
I think you opened a bug report, to which I responded that your configure line is malformed.
The configure line you want to use is:
./configure --enable-pthreads --enable-maintainer-zts
The above command will build pthreads as a DSO.
./configure --enable-pthreads=static --enable-maintainer-zts
The above command will build pthreads statically into PHP.
Both are equally supported by 5.3, 5.4 and even 5.5.
Additionally, if you are overwriting your system installation then you should use a specific --prefix, for example, if you php executable is at /usr/bin ( which you can ascertain with "which php" ), then --prefix=/usr will overwrite your system installation.
Clean out your old installations ( do make uninstall if the sources are still available ). Start again, ensure you are either, overwriting the system installation or isolating this one completely.
Please update the bug report when you have worked it out.

can't get odbc working in apache

I installed unixODBC by using apt-get install, and now when I try to use odbc_connect() is still get this error.
PHP Fatal error: Call to undefined function odbc_connect()
what do i need to do to configure it to work with php? I have been looking online but I can't really figure it out.
I think you need to install php5-odbc also. unixODBC provides the driver manager, but you need the PHP code that calls it.
Had the same issue on CentOS 6.3 with PHP 5.3.16. But the fix was to use yum to install php-odbc.
yum install php-odbc
Did you add it to your LD_LIBRARY_PATH? Check the documentation for your server, it may require third-party libraries to be in a specific sub-directory, or have some other mechanism for finding them. If so, you should be able to create a symbolic link to the library. That way, if it gets updated, your server will automatically use it.
We had this problem also. We installed php5-odbc, and still had the problem. Turns out we needed to reboot Linux for php to see the function. Recycling Apache was not enough!
Make sure to enable odbc extension for your Apache by a2enmod odbc.
Then check if exists by: apache2ctl -M.
If you don't have this extension, install via apt-get install php-odbc (use yum in case of CentOS).
See also: Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS.

Recompile and reinstalling php

I am running Fedora Core 10 with php 5.2.9 without ldap. Now i want to remove current php installation and recompile the latest version of php with ldap and install it.
How to do this?
Basically, download the sources from the PHP website. Then, from a terminal, type './configure --prefix=/usr/local/my_php_version'
In the output, checks if it recognize your LDAP installation (and also the Apache one). If not, take a look at the configuration options to learn how to specify the paths. Something like '--with-openldap', '--with apxs', etc.
You should also take a look at the configuration options to active the features you need.
Once you're done, type 'make', then 'sudo make install'.
Also take a look at the official install documentation: http://www.php.net/manual/en/install.unix.php
Instead of re-compiling the PHP, you can add the LDAP support to the PHP you have installed.
You can install a variety of libraries and modules without recompiling PHP. To see the libraries that are available, you can execute
yum search php-
To install LDAP for your PHP, you can execute
yum install php-ldap
If you have PHP as an Apache module, you must restart the httpd to activate the changes
service httpd restart

Using PECL to install extensions on Windows 7

I've been trying to install some PECL extensions on my laptop, but I've ran into a few problems. Whenever I run pecl install whatever from the command line I get a message saying ".\php.exe appears to have a suffix .exe, but config variable php". It seems like PECL is using PEAR to perform installations. I checked and php_suffix is located in the files PEAR_Config.php and PEAR_Builder.php, but I'm not sure what to do with it in there.
Any ideas on how to fix this or workarounds? Unfortunately the pecl4win seems to be down, and http://downloads.php.net/pierre/ the site I usually go to for the .dll's has outdated versions for the version of PHP I'm using (5.3.1).
Unfortunately I don't know the specifics, but at least I can point you in the right direction To use pecl on windows, you need to setup Visual Studio c/c++ or MingW32 c/c++ and then configure pecl to use either compiler for building the requested extensions.
Unlike pear packages, pecl packages are PHP c extensions that needed to be compiled against your local PHP install.
Update
https://wiki.php.net/internals/windows/stepbystepbuild A mostly friendly wiki page on setting up a windows box for building PHP from source. Looks like you need to build the interpreter and support libraries before you can get pecl working.

Categories