How to enable mbstring from php.ini? [closed] - pdf

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have real difficulties with enabling mbstring extension on my localhost.
I'm using XAMPP 1.7.4, for Windows, which has PHP 5.3.5, and tried to edit my php.ini file according to the documentation and various other examples I found online. After about 6 hours of this, all I managed to do is get a "Error 500 - Server error' message, that didn't go away even after I rolled-back all changes to the .ini file.
What I need to do, is create PDF invoices with Danish characters, using tFPDF, to support UTF-8 encoding.
If anybody here knows some tips, suggestions, or an example of a working php.ini setup, please help out, 'cause I'm starting to lose my hair over this one! :|
Thanks a lot!

All XAMPP packages come with Multibyte String (php_mbstring.dll) extension installed.
If you have accidentally removed DLL file from php/ext folder, just add it back (get the copy from XAMPP zip archive - its downloadable).
If you have deleted the accompanying INI configuration line from php.ini file, add it back as well:
extension=php_mbstring.dll
Also, ensure to restart your webserver (Apache) using XAMPP control panel.
Additional Info on Enabling PHP Extensions
install extension (e.g. put php_mbstring.dll into /XAMPP/php/ext directory)
in php.ini, ensure extension directory specified (e.g. extension_dir = "ext")
ensure correct build of DLL file (e.g. 32bit thread-safe VC9 only works with DLL files built using exact same tools and configuration: 32bit thread-safe VC9)
ensure PHP API versions match (If not, once you restart the webserver you will receive related error.)

Related

How to access html file using local host [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Please I need help with accessing my html/php file with localhost on my browser,i turn my xampp on and tried to access my html/php file,but it is still not working
That's what I keep getting everytime
The path component of the URL to your file starts at the directory specified in the DocumentRoot configuration option for your Apache HTTPD server. This probably defaults to the htdocs directory.
It doesn't start at the root of your filesystem. Web servers do not, by default, expose every file on your hard disk to the network (which would be a scary default for security reasons).
Normally you don't have to enter xampp/htdocs in the link. localhost is reffering to your xampp htdocs folder "automatically". Try localhost/phpinvscode
If you put your index.html file in the htdocs folder directly you would only need to enter localhost in the browser.

Removal of the /var/www/icons alias from Apache config [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a directory called /var/www/icons on my web server, which is also referenced as an alias in my Apache config as seen below:
Alias /icons/ "/var/www/icons/"
The directory contains a number of small PNGs and GIFs, which AFAIK are unused, along with a README file.
Am I safe to remove this alias from my Apache config by commenting it out? If not, what area of my application is the removal of this likely to effect?
There is very little documentation available on this directory and I must admit i've never came across it up until now.
Most icons are used for displaying file types in directory listings. If you do not use such listings, you can safely remove alias + files. I did so and do not miss them.
It is for sure safe to remove it. Other conf files could reference /icons (e. g. the autoindex module) but apart from some not found errors nothing nasty should happen.
My advice: scan the access.log files to see if urls rooted at /icons are accessed. Delete the alias and monitor the error.log file for 404 errors.

apache and sftp permissions for wordpress automatic update in ubuntu [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
It's my first time trying to set up Wordpress or any website on a cloud hosting. I am on Ubuntu server, and Wordpress is located in var/www/mydomain/public folder.
What I want to achieve is this: Both Wordpress (PHP) and SFTP users can access and modify the same files. And Wordpress should be able to do it's automatic update for plugins, etc.
This is what I have done so far:
I have chmodded this folder to 775 to allow group read/write permissions.
I have added apache user (www-data) and SFTP user (suser) both to group wp.
I have made wp as the group owner of all files inside the wordpress folder.
What works:
I can edit theme and plugin files with Wordpress's built-in theme/plugin editor.
What does not work:
Wordpress update still asks for the FTP details to carry out the update
When I create a new file with SFTP user, it's permissions will be 644, but they should be 775
What I've tried
I have tried all the steps here (answer by caf): A general linux file permissions question: Apache and WordPress
I have tried this: http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions
I have also tried adding umask 002 to my SFTP startup login files, but I do not know where they are located.
As far as I understand, the problem lies somewhere with the permissions/umask thing. I know very little about linux so this may be a stupid question with a simple solution, but I have no idea how to fix it.
UPDATE: I did not know that I would have to restart the ssh server. I did it with this command /etc/init.d/ssh restart and after that files created with SFTP have permissions 664 (as they are supposed to)
Also, it seems that Apache has to be restarted as well, with this command: /etc/init.d/apache2 restart
However, Wordpress still won't do automatic update (asks for FTP credentials)
If you're able to install the SSH2 PHP Module Wordpress will then give you the option to upgrade over SFTP.
In Ubuntu:
sudo apt-get install libssh2-php
In CentOS (EPEL required):
sudo yum install php-pecl-ssh2
I was trying to do the same thing with Wordpress updates, until I realized that Wordpress only supports FTP which, confusingly, SFTP is not. From Wikipedia:
FTPS should not be confused with the SSH File Transfer Protocol
(SFTP), an incompatible secure file transfer subsystem for the Secure
Shell (SSH) protocol. It is also different from Secure FTP, the
practice of tunneling FTP through an SSH connection.
I'm still trying to figure out if there's a secure way to do Wordpress updates automatically; I don't know yet whether or not FTPS is truly secure.

How can one reference subdomains on a dev server that also correctly resolve on a production server? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've got a LAMP dev server at something like dev.example.com. Eventually this will be replicated to something like www.example.com where we will have root access.
I'd like to have the sys admin set up a few subdomains (e.g., subdomain1.example.com) such that they will work on both the dev server and the production server without the references to those subdomains having to be rewritten.
Can Apache be configured on the dev and production servers such that my code can reference something like subdomain1.localhost? Is there some other way of doing this?
(The servers will run recent versions of CentOS and the AMP stack.)
I finally found the answer in the CDN module. As the name implies, this is intended to be used with content delivery networks but essentially all it does is a rule-based re-writing of the URLs that Drupal outputs. I've used it to re-write URLs so that different file types can be served from unique hostnames (again, to maximize parallel downloads).
reading your question again, I think that you want your code to always return subdomain1.localhost, and you want apache to somehow change this to subdomain1.example.com on your production server.
You could do this with ProxyPassReverse, although you might have to run two copies of Apache if the subdomain1 is on the same machine. (I don't know if Apache will cope with talking to itself here). This is an expensive solution.
Instead, I recommend your parameterize your code.
On rails stacks, the easiest way to do this with the production.rb cp that capistrano recommends, and you might want to investigate similar ways of deploying your PHP code.

Best way to rotate Apache log files [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've got an Apache server that has one access log file that is topping 600MB. This makes it really hard to search the file or parse it.
What software or modules for Apache are available that will make a daily copy of my access file to make it more manageable?
Have you looked at logrotate - this is probably the simplest, most widely available and well understood method of achieving this. It is highly configurable and will probably do 90% of what you need.
I'm a big fan of Cronolog. Just install and pipe your logs through it. For daily log rotation, something like this would work:
ErrorLog "|/usr/bin/cronolog /path/to/logs/%Y-%m-%d/error.log"
CustomLog "|/usr/bin/cronolog /path/to/logs/%Y-%m-%d/access.log" combined
Pretty handy, and once installed, easier (in my experience) than logrotate.
The actual command for Windows, which is quite difficult to find online is:
CustomLog '|" "*Apache-Path/bin/rotatelogs.exe"
"**Apache-Path*/logs/backup/internet_access_%d-%m-%y.log" 86400' combined
Where the "internet_access" bit is the name you choose for your files, the 86400 is the number of seconds in one day. You need to change the Apache-Path to the relevant directory you've installed Apache to.
logrotate
logrotate is probably the best solution. Use the file /etc/logrotate.conf to change the settings for all your logs. You van change weekly to daily so the logs are rotated every day. Also, you might want to add compress so the archives are compressed. If you don't care about the old logs, you can set rotate rotate 4 to something lower.
CustomLog "|bin/rotatelogs /var/logs/logfile 5M" common
This configuration will rotate the logfile whenever it reaches a size of 5 megabytes.
ErrorLog "|bin/rotatelogs /var/logs/errorlog.%Y-%m-%d-%H_%M_%S 5M"
This Would Be Best Way to Redirect Apache logs. No need to compile mod with httpd.
rotatelog.exe or cronolog.exe on windows os. They are used in pipe command in http.conf
Mod_log_rotate additional module for apache ONLY for access log rotation
Logrotate ONLY for unix os.
I have a module that does this for you without the need for external pipes etc :
http://www.poptart.org/bin/view/Poptart/ModAutorotate
I've tried to add it to the Apache modules collection but that seems to have been broken for a while now.