I have used MPDF to generate PDF file and I got an error
(Uncaught Mpdf\MpdfException: Mpdf cannot function properly with mbstring.func_overload enabled)
My PHP version is 7.1 and my operating system is centos. How can I fix this problem?
Got your server php.ini and remove the semicolon character (;) in front of the line below-
extension = php_mbstring.dll
Then, restart your server. For more details, you can visit this.
You can change your apache configuration (in my case it was in /etc/httpd/...).
<VirtualHost ...>
...
<Directory /var/www/website/folder/to/your/action/page/>
AllowOverride All
mbstring.func_overload 0
</Directory>
...
Or you could change it for the whole website:
<VirtualHost ...>
...
<Directory /var/www/website/>
AllowOverride All
mbstring.func_overload 0
</Directory>
...
Then restart apache using
sudo service httpd restart
Related
Alright, I have spent hours searching through very similar questions but I still don't seem to have found the answer:
I have set up a virtual host with the following in my httpd-vhosts.conf
Listen 80
<VirtualHost *:80>
ServerName test.dev
ServerAlias test.dev
DocumentRoot "/Users/OrangeSoda/OneDrive/Projects/Test/Website"
ErrorLog "/private/var/log/apache2/test.dev-error_log"
CustomLog "/private/var/log/apache2/test.dev-access_log" common
<Directory "/Users/OrangeSoda/OneDrive/Projects/Test/Website">
Options all
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
In my http.conf I have Include /private/etc/apache2/extra/httpd-vhosts.conf as well as LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so uncommented.
When I go to test.dev/index.php which just has <?php echo "PHP TEST"; ?>, I see the contents of the file output as a string.
It seems as though PHP is not enabled and is therefore not being recognized.
If i go to localhost, I do see the "It Works!" page, so I know php is working, just for some reason not on my virtual host.
Someone suggested to put php_admin_flag engine on but that just makes the whole page crash.
Does anybody understand why php is not enabled here?
Have you checked if port 80 is opened? It might help more if you include detailed log.
You're on the right track but you need to actually load php onto the virtual host. On the <Directory> entry, add these lines :
<IfModule sapi_apache2.c>
php_admin_flag engine on
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
</IfModule>
I got the solution from here.
It looks like mod-php may not be installed. What OS are you on?
On Ubuntu/debian:
sudo apt-get install php5
on redhat:
sudo yum install php
The solution was that while php was enabled, for some reason the default setting in httpd.conf was not to read .php files as .php.
Although I am not really sure why that would not be the default setting, I added the following to my httpd.conf and now it works just fine:
AddType application/x-httpd-php .php
I have a php script to upload files in a directory.
This works fine in apache's DocumentRoot.
When I copy the code in my /home/$USER/public_html , instead of the right output I just when a printout of the php file. I presume it does not get executed.
I was looking into the userDir module and found this
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
includesNoExec looked promising but it is related to cgi only.
So how can I enable php scripts to be executed for every user?
Try setting this configuration:
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_value engine On
</Directory>
</IfModule>
Don't forget to restart Apache.
service apache2 restart
It turns out the important bit of code that Claudix provided is already present in the configuration files under /etc/apache2/mods-available/php5.conf
the clause there contains php_admin_value engine Off , so by setting the Claudix solution anywhere will conflict with this setting. What is more, the comment above suggests NOT to set php_admin_value engine On as it renders .htaccess files unable to disable php.
As such the correct way to run php in user www directories is by commenting out the relevant text in /etc/apache2/mods-available/php5.conf
I assume you are using apache2 on debian like I do and I think the solution
for you is to add Alias dir and set that alias dir config like below
1 edit the apache2 configuration from terminal run this command
sudo gedit /etc/apache2/sites-enabled/000-default
2 edit the path you will to execute PHP files and save
Alias /testdir /home/user/testdir
<Directory /home/user/testdir>
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
</Directory>
3 restart apache2
sudo service apache2 restart
check If you can access the folder from browser if not probably you will have to chmod/chown the folder
yourhost/testdir
According to Apache 2.2 documentation this can be done by uncommenting this configuration line:
#Include conf/extra/httpd-userdir.conf
and modifying httpd-userdir.conf to suit your server. Based on your qustion text, this should resolve your issue.
I've installed Apache 2.2 server and PHP 5.3 on Windows XP SP3. After the initial install, Apache loaded the test page, i.e.,
http:/localhost (C:/Program Files/Apache2.2/htdocs/index.html) showed "It works!".
After configuring Apache and installing PHP, trying to load http:/localhost/phptest.php i.e. (C:/testsite/htdocs/phptest.php).
But this throws an error:
Not Found. The requested URL /phptest.php was not found on this server.
I also get the same error now loading
http://localhost
httpd.conf edits:
ServerName localhost:80
DocumentRoot "C:/testsite/htdocs"
<Directory "C:/testsite/htdocs">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
LoadModule php5_module "c:/testsite/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddHandler application/x-httpd-php .php
PHPIniDir "C:/testsite/php"
File php.ini edits:
include_path = ".;C:\testsite\php\includes"
extension_dir = "C:/testsite/php/ext/"
System path:
The PHP directory was added to the Windows path, e.g.
PATH=C:\Windows\System32;C:\many_dir;C:\testsite\php
The only errors in the Apache error.log are:
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2 /docs/dummy-host.localhost] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.localhost] does not exist
Warning: DocumentRoot [C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost] does not exist
The Apache service restarts successfully and is running. I can't find anything amiss. Can anyone spot any stupid errors?
Try changing Deny from all to Allow from all in your conf and see if that helps.
In httpd.conf file you need to remove #
#LoadModule rewrite_module modules/mod_rewrite.so
after removing # line will look like this:
LoadModule rewrite_module modules/mod_rewrite.so
And Apache restart
I had the same problem, but believe it or not is was a case of case sensitivity.
This on localhost:
http://localhost/.../getdata.php?id=3
Did not behave the same as this on the server:
http://server/.../getdata.php?id=3
Changing the server url to this (notice the capital D in getData) solved my issue.
http://localhost/.../getData.php?id=3
Non-trivial reasons:
if your .htaccess is in DOS format, change it to UNIX format (in Notepad++, click Edit>Convert )
if your .htaccess is in UTF8 Without-BOM, make it WITH BOM.
Hi I have this error while I'm trying to launch phpPgAdmin:
Your PHP installation does not support PostgreSQL. You need to recompile PHP using the --with-pgsql configure option.
I'm using XAMPP ver 1.7.7, Postgresql 9.2.4 64 bit, and phpPgAdmin 5.1.
I already did the following:
Open config.inc.php found in C:\xampp\phpPgAdmin\conf\ and set extra_login_security to false
$conf['extra_login_security'] = false;
Find php.ini file in C:\xampp\php\, then look for the line ; extension = php_pgsql.dll. Remove tag ;, so that the
result was extension = php_pgsql.dll.
(although I found php.ini- production and development so I uncomment them both)
Open C:\xampp\apache\conf\extra\httpd-xampp.conf and in section <IfModule mime_module> add
Alias /phppgadmin "c:/xampp/phpPgAdmin/"
<Directory "c:/xampp/phpPgAdmin">
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
LoadFile “C:/xammp/php/libpq.dll”
but I still get this error. Can someone help me?
I am writing the answer from the beginning, not everything what you tried was wrong.
xampp is up and running.
Download phpPgAdmin and copy it into c:\xampp\phpPgAdmin
Modify the config file
C:\xampp\apache\conf\extra\httpd-xampp.conf
Add like phpMyAdmin part the phpPgAdmin part:
Alias /phppgadmin "C:/xampp/phpPgAdmin/"
<Directory "C:/xampp/phpPgAdmin">
AllowOverride AuthConfig
Require all granted
</Directory>
Restart apache and enter in browser
http://127.0.0.1/phppgadmin/
Now you would get the message: install php with –-pqsql option
Postgres installation and the configuration:
Install postgresql 32bit even if you have 64bit windows (this is not a joke)
Postgres is now up and running
Modify again the config file
C:\xampp\apache\conf\extra\httpd-xampp.conf
Add the following line (in my case PostgreSQL is installed in C:/xampp/PostgreSQL):
LoadFile "C:/xampp/PostgreSQL/bin/libpq.dll"
before the following existing lines
LoadFile "C:/xampp/php/php5ts.dll"
LoadModule php5_module "C:/xampp/php/php5apache2_4.dll"
Modify the config file
C:\xampp\php\php.ini
Uncomment the following line by removing ';'
;extension=php_pgsql.dll
Restart apache and enter again in your browser
http://127.0.0.1/phppgadmin/
It should work, it works for me
Not need to install postgresql 32 bit version just enable php_pgsql.dll extension in your php.ini file and do restart apache service
event though you get error like "cdbconnection failed to open the db connection could not find driver postgresql" then
please add below line in php.ini file and restart apache
extension=php_pdo_pgsql
Now it should work perfact
Just make sure in your C:\xampp\php\php.ini to uncomment the following line by removing ';'
extension=php_pdo_pgsql
extension=pgsql
or if you don't have those lines then add them.
Then restart Apache and it should work just fine.
I already install zend framework and i used wamp server to let it works then in httpconfig i inserted
NameVirtualHost 127.0.0.1
DocumentRoot "C:\Workspace\zendy\public"
ServerName zendy
<Directory "C:\Workspace\zendy\public">
Options FollowSymLinks
AllowOverride AuthConfig Limit Indexes
Order allow,deny
Allow from all
</Directory>
after restarting wamp server ... the below message appears
Internal Server Error
i know the error in virtualhost. however, i couldn't solve the problem
You can enable rewrite module directly by clicking wamp tray icon and going into Apache settings. Like example below.
If you still find some problems you may need to add zendy server name to your system C:\Windows\System32\drivers\etc\hosts file:
127.0.0.1 zendy
Also you must uncomment vhosts in Apache httpd.conf:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Hope that helps!
just look into Apache Error Log, you should see what exactly caused Internal Server Error there