Nikhil Vaghela
Nikhil Vaghela

Reputation: 2096

Fatal error: Call to undefined function posix_uname()

I am running under windows php, but a used posix_uname() lies

Fatal error: Call to undefined function posix_uname().

Upvotes: 2

Views: 3822

Answers (2)

user4244405
user4244405

Reputation:

As stated by @Thamizhan, POSIX is not available in Windows; however, if you need to use it, and if your target platform is a Linux server anyway; the following will make it possible to develop & test on your Windows development machine, but it will run under Linux:

  • Install VirtualBox, and inside it install Linux; this may help: http://www.instructables.com/id/How-to-install-Linux-on-your-Windows/
  • Depending on your requirements, try a minimal linux distro, like Arch, but if you like working with graphical user interfaces and your machine can take it, by all means pimp it up!
  • After installing Linux, install the "LAMP stack"; depending on which Linux distribution you chose, the installation will most likely be available in its default repositories.
  • Lastly, in your virtual box settings, share some folders for your projects.

After all the above is ready, if POSIX is not already installed, you can just install it by reading up on your specific distro, but here's a good article: https://wiki.archlinux.org/index.php/PHP

After all your requirements are installed, remember to restart the Apache server; the link will help with this; but, again, choose a distro you feel comfortable with, maybe Ubuntu, -or Mint could aid in "smooth transition" over to Linux :)

Upvotes: 1

Thamilhan
Thamilhan

Reputation: 13313

According to the POSIX manual in PHP.net

This extension is not available on Windows platforms.

Upvotes: 5

Related Questions