{"id":2007,"date":"2011-08-30T16:46:25","date_gmt":"2011-08-30T16:46:25","guid":{"rendered":"https:\/\/supportex.net\/?p=2007"},"modified":"2019-05-10T18:29:34","modified_gmt":"2019-05-10T16:29:34","slug":"rpm-building-proctitle-php","status":"publish","type":"post","link":"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/","title":{"rendered":"RPM: building proctitle for PHP"},"content":{"rendered":"<p>Sometimes it&#8217;s convenient to change PHP script name, it allows to check if it&#8217;s running by typing just pstree. You can perform that with use of <a href=\"http:\/\/pecl.php.net\/package\/proctitle\">proctitle<\/a>. Unfortunately there is no rpm for this package for Fedora 15. So to use it you need to build it. Firstly you need to download <a href=\"http:\/\/pecl.php.net\/get\/proctitle\">source<\/a> package to your rpmbuild\/SOURCES directory. \u00a0Put this spec file to SPECS:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">%define modname proctitle\n%global php_apiver %((echo 0; php -i 2&gt;\/dev\/null | sed -n 's\/^PHP API =&gt; \/\/p') | tail -1)\n%global php_extdir %(php-config --extension-dir 2&gt;\/dev\/null || echo \"undefined\")\n%global php_version %(php-config --version 2&gt;\/dev\/null || echo 0)<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">Name: php-pecl-proctitle\nVersion: 0.1.1\nRelease: 1%{?dist}\nSummary: Allows setting the current process name on Linux and BSD<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">Group: Development\/Languages\nLicense: PHP\nURL: http:\/\/pecl.php.net\/package\/proctitle\nSource0: http:\/\/pecl.php.net\/get\/proctitle-0.1.1.tgz\nSource1: %{modname}.ini\nBuildRoot: %{_tmppath}\/%{name}-%{version}-%{release}-buildroot<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">BuildRequires: php-devel\nRequires: php(zend-abi) = %{php_zend_api}\nRequires: php(api) = %{php_apiver}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">%description\nThis extension allows changing the current process' name on Linux and *BSD systems. This is useful when using pcntl_fork() to identify running processes in process list.<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">%prep\n%setup -n -q %{modname}-%{version}\n[ \"..\/package.xml\" != \"\/\" ] &amp;&amp; mv ..\/package.xml .\ncp %{SOURCE1} %{}\nfind . -type d -exec chmod 755 {} ;\nfind . -type f -exec chmod 644 {} ;<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">%build\n%{_bindir}\/phpize\n%configure\nmake %{?_smp_mflags}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">%install\nrm -rf $RPM_BUILD_ROOT\nmake install INSTALL_ROOT=$RPM_BUILD_ROOT<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\"># install configuration\n%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}\/php.d\n%{__cp} %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}\/php.d\/\n%clean\nrm -rf $RPM_BUILD_ROOT<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">%files\n%defattr(-,root,root,-)\n%doc LICENSE README package*.xml\n%config(noreplace) %{_sysconfdir}\/php.d\/%{modname}.ini\n%{php_extdir}\/proctitle.so<\/pre>\n<p>Run rpmbuild:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[builder@playground BUILD]$ rpmbuild -ba ..\/SPECS\/php-pecl-proctitle.spec<\/code><\/p>\n<p>After it finishes you will get built rpm:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[builder@playground rpmbuild]$ rpm -qpl RPMS\/x86_64\/php-pecl-proctitle-0.1.1-1.fc15.x86_64.rpm\n\/etc\/php.d\/proctitle.ini\n\/usr\/lib64\/php\/modules\/proctitle.so\n\/usr\/share\/doc\/php-pecl-proctitle-0.1.1\n\/usr\/share\/doc\/php-pecl-proctitle-0.1.1\/LICENSE\n\/usr\/share\/doc\/php-pecl-proctitle-0.1.1\/README\n\/usr\/share\/doc\/php-pecl-proctitle-0.1.1\/package.xml\n[builder@playground rpmbuild]$<\/pre>\n<p>Create test file:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">&amp;lt;?php setproctitle(\"myscript\"); sleep(60); ?&amp;gt;<\/code><\/p>\n<p>And check:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[web@playground ~]$ ps axu | grep m[y]\nbuilder 28272 1.3 1.1 387524 11720 pts\/2 S+ 07:39 0:00 myscript\n[web@playground ~]$<\/pre>\n<p><strong>Didn&#8217;t find the answer to your question? <a href=\"\/contacts\/\">Ask it<\/a> our administrators to reply we will publish on website.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes it&#8217;s convenient to change PHP script name, it allows to check if it&#8217;s running by typing just pstree. You can perform that with use of proctitle. Unfortunately there is no rpm for this package for Fedora 15. So to use it you need to build it. Firstly you need to download source package to&hellip; <\/p>\n<div class=\"readmore-wrapper\"><a href=\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/\" class=\"more-link\">Read <\/a><\/div>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[152],"tags":[275,238],"class_list":["post-2007","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-php-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>RPM: building proctitle for PHP &#8211; Supportex.NET blog<\/title>\n<meta name=\"description\" content=\"How to build RPM proctitle for PHP\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RPM: building proctitle for PHP &#8211; Supportex.NET blog\" \/>\n<meta property=\"og:description\" content=\"How to build RPM proctitle for PHP\" \/>\n<meta property=\"og:url\" content=\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Supportex.NET blog\" \/>\n<meta property=\"article:published_time\" content=\"2011-08-30T16:46:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-10T16:29:34+00:00\" \/>\n<meta name=\"author\" content=\"Oleksii Tykhonov\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oleksii Tykhonov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/\"},\"author\":{\"name\":\"Oleksii Tykhonov\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\"},\"headline\":\"RPM: building proctitle for PHP\",\"datePublished\":\"2011-08-30T16:46:25+00:00\",\"dateModified\":\"2019-05-10T16:29:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/\"},\"wordCount\":105,\"commentCount\":0,\"keywords\":[\"linux\",\"php\"],\"articleSection\":[\"linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/\",\"url\":\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/\",\"name\":\"RPM: building proctitle for PHP &#8211; Supportex.NET blog\",\"isPartOf\":{\"@id\":\"https:\/\/supportex.net\/blog\/en\/#website\"},\"datePublished\":\"2011-08-30T16:46:25+00:00\",\"dateModified\":\"2019-05-10T16:29:34+00:00\",\"author\":{\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\"},\"description\":\"How to build RPM proctitle for PHP\",\"breadcrumb\":{\"@id\":\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/supportex.net\/blog\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RPM: building proctitle for PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#website\",\"url\":\"https:\/\/supportex.net\/blog\/en\/\",\"name\":\"Supportex.NET blog\",\"description\":\"Server and network management company\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/supportex.net\/blog\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\",\"name\":\"Oleksii Tykhonov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g\",\"caption\":\"Oleksii Tykhonov\"},\"url\":\"https:\/\/supportex.net\/blog\/author\/oleksiitykhonov\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RPM: building proctitle for PHP &#8211; Supportex.NET blog","description":"How to build RPM proctitle for PHP","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/","og_locale":"en_US","og_type":"article","og_title":"RPM: building proctitle for PHP &#8211; Supportex.NET blog","og_description":"How to build RPM proctitle for PHP","og_url":"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/","og_site_name":"Supportex.NET blog","article_published_time":"2011-08-30T16:46:25+00:00","article_modified_time":"2019-05-10T16:29:34+00:00","author":"Oleksii Tykhonov","twitter_misc":{"Written by":"Oleksii Tykhonov","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/#article","isPartOf":{"@id":"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/"},"author":{"name":"Oleksii Tykhonov","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251"},"headline":"RPM: building proctitle for PHP","datePublished":"2011-08-30T16:46:25+00:00","dateModified":"2019-05-10T16:29:34+00:00","mainEntityOfPage":{"@id":"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/"},"wordCount":105,"commentCount":0,"keywords":["linux","php"],"articleSection":["linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/","url":"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/","name":"RPM: building proctitle for PHP &#8211; Supportex.NET blog","isPartOf":{"@id":"https:\/\/supportex.net\/blog\/en\/#website"},"datePublished":"2011-08-30T16:46:25+00:00","dateModified":"2019-05-10T16:29:34+00:00","author":{"@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251"},"description":"How to build RPM proctitle for PHP","breadcrumb":{"@id":"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/supportex.net\/blog\/2011\/08\/rpm-building-proctitle-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/supportex.net\/blog\/en\/"},{"@type":"ListItem","position":2,"name":"RPM: building proctitle for PHP"}]},{"@type":"WebSite","@id":"https:\/\/supportex.net\/blog\/en\/#website","url":"https:\/\/supportex.net\/blog\/en\/","name":"Supportex.NET blog","description":"Server and network management company","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/supportex.net\/blog\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251","name":"Oleksii Tykhonov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g","caption":"Oleksii Tykhonov"},"url":"https:\/\/supportex.net\/blog\/author\/oleksiitykhonov\/"}]}},"_links":{"self":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/comments?post=2007"}],"version-history":[{"count":4,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2007\/revisions"}],"predecessor-version":[{"id":3199,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2007\/revisions\/3199"}],"wp:attachment":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/media?parent=2007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/categories?post=2007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/tags?post=2007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}